Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/235.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
Javascript 无法在Wordpress中加载js脚本_Javascript_Php_Wordpress - Fatal编程技术网

Javascript 无法在Wordpress中加载js脚本

Javascript 无法在Wordpress中加载js脚本,javascript,php,wordpress,Javascript,Php,Wordpress,我试图从我的自定义Wordpress主题获得js中的两个自定义脚本。 我在functions.php add_action( 'wp_enqueue_scripts', 'add_my_script' ); function add_my_script() { wp_register_script('html2Canvas',get_template_directory_uri() .'/js/html2canvas.js', array('jquery'),true); wp_re

我试图从我的自定义Wordpress主题获得js中的两个自定义脚本。 我在
functions.php

add_action( 'wp_enqueue_scripts', 'add_my_script' );
function add_my_script() {
   wp_register_script('html2Canvas',get_template_directory_uri() .'/js/html2canvas.js', array('jquery'),true);
   wp_register_script('CustomController',get_template_directory_uri() . '/js/CustomController.js', array('jquery','html2canvas'),true);
   wp_enqueue_script('html2Canvas');
   wp_enqueue_script('CustomController');
}
followin文件夹结构中的

<theme_folder>
 |- functions.php
 |-js
   |- html2canvas.js
   |- CustomController.js 
 |[...]

|-functions.php
|-js
|-html2canvas.js
|-CustomController.js
|[...]

浏览器控制台中出现错误?控制台或dockers日志中没有错误您是否在footer.php中编写了wp_footer()?太好了!谢谢您的评论@AndrewSchultz