Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在使用jquery脚本添加操作时修复(T_常量_封装的_字符串)_Php_Wordpress - Fatal编程技术网

Php 如何在使用jquery脚本添加操作时修复(T_常量_封装的_字符串)

Php 如何在使用jquery脚本添加操作时修复(T_常量_封装的_字符串),php,wordpress,Php,Wordpress,我试图从头开始创建wordpress主题,但在添加 add_action('wp_enqueue_scripts', 'jquery'); 让我的js脚本警报在我得到的页面上弹出 分析错误:语法错误,意外“”,1,true);' (T_常量_封装的_字符串),应为“')” 为了那条线 function include_jquery() { wp_deregister_script('jquery'); wp_enqueue_script('jquery', get_template_d

我试图从头开始创建wordpress主题,但在添加

add_action('wp_enqueue_scripts', 'jquery');
让我的js脚本警报在我得到的页面上弹出

分析错误:语法错误,意外“”,1,true);' (T_常量_封装的_字符串),应为“')”

为了那条线

function include_jquery() {
  wp_deregister_script('jquery');
  wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery3.3.1.min.js, '', 1, true);
  add_action('wp_enqueue_scripts', 'jquery');
}
add_action('wp_enqueue_scripts', 'include_jquery');
我希望代码能从我的js文件中显示我的警报

$(document).ready(function() {  
  alert('test');
})
打字错误。改变

wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery3.3.1.min.js, '', 1, true);


jquery.min.js字符串后面缺少一个
。我强烈建议使用带有语法突出显示的IDE,因为它几乎不可能漏掉这样的输入错误。是的,使用IDE或只是用linter插件设置文本编辑器,这将帮助您防止输入错误谢谢,我想我累了我发现了其他3个基本错误,也可能是一个盲人试图编码lolomg不好意思,我已经编码了7-8个小时,大约2个小时前就开始了,但想在睡觉前完成,谢谢,我知道这种感觉。请记住,解析错误总是您的错;-)我不知道,非常感谢
wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery3.3.1.min.js', '', 1, true);