问题描述
我已经使用add_action('wp_enqueue_scripts','function_name')
将外部JS文件放入wordpress function.PHP中,浏览器获取了JS文件,并且在Debugger中也可以看到该文件。
解决方法
经过长期调查,我发现了问题。并修复它。
问题:外部JS文件被嵌入到iframe(Wordpress Customizer Preview。)中,而我试图从Customizer Controller进行访问。
解决方案:我使用add_action('customize_controls_enqueue_scripts','function_name');
进入外部JS文件。