我已将wordpress从一个域移到另一个域。在第一个域上,一切正常。第二秒钟,我将一堆JS错误记录到控制台。网站的网址为https://dexport.co.uk
我遇到的错误如下:
Uncaught SyntaxError: Invalid or unexpected token
jquery.js:3 Uncaught SyntaxError: Invalid or unexpected token
jquery-migrate.js?ver=1.4.1:752 Uncaught ReferenceError: jQuery is not defined
at jquery-migrate.js?ver=1.4.1:752
(index):1 Uncaught SyntaxError: Unexpected identifier
at layerslider.kreaturamedia.jquery.js?ver=6.7.6:13
(index):1 Uncaught SyntaxError: Invalid or unexpected token
at layerslider.transitions.js?ver=6.7.6:13
jquery.themepunch.tools.min.js?ver=5.4.8:23 Uncaught ReferenceError: jQuery is not defined
at jquery.themepunch.tools.min.js?ver=5.4.8:23
at jquery.themepunch.tools.min.js?ver=5.4.8:23
jquery.themepunch.revolution.min.js?ver=5.4.8:7 Uncaught ReferenceError: jQuery is not defined
at jquery.themepunch.revolution.min.js?ver=5.4.8:7
gtm4wp-form-move-tracker.js?ver=1.8.1:1 Uncaught ReferenceError: jQuery is not defined
at gtm4wp-form-move-tracker.js?ver=1.8.1:1
add-to-cart.js?ver=3.4.5:2 Uncaught ReferenceError: jQuery is not defined
at add-to-cart.js?ver=3.4.5:2
woocommerce-add-to-cart.js?ver=5.5.4:1 Uncaught TypeError: window.jQuery is not a function
at woocommerce-add-to-cart.js?ver=5.5.4:1
(index):1315 Uncaught ReferenceError: jQuery is not defined
at (index):1315
(index):1415 Uncaught ReferenceError: jQuery is not defined
at (index):1415
(index):1449 Uncaught ReferenceError: jQuery is not defined
at (index):1449
core.min.js?ver=1.11.4:11 Uncaught ReferenceError: jQuery is not defined
我在wp-config中添加了几行:
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
define( 'CONCATENATE_SCRIPTS', false );
define( 'SCRIPT_DEBUG', true );
但没有成功
答案 0 :(得分:0)
错误消息说:Uncaught ReferenceError: jQuery is not defined
我想您正在将这些库存储在服务器中,并且没有使用CDN。 验证是否在安装中正确定义了导致诸如jQuery之类的库的路径,并且正确设置了文件权限。
答案 1 :(得分:0)
1)打开活动主题的header.php文件
2)粘贴在脚本下方
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
紧随head标签之后。
3)保存文件。