【发布时间】:2014-06-22 14:35:53
【问题描述】:
我有一个 WordPress 网站,它使用 jQuery Mega Menu 插件 和 theme-my-login 都调用:
<script type='text/javascript'src='http://localhost/wadhaa/dynamic/wp-includes/js/jquery/jquery.js?ver=1.11.0'></script>
在我的头部分:
<?php
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>
我必须包括:
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
这会导致与 WordPress jquery.js 发生冲突
谁能帮我解决这个问题?或者至少让我知道为什么会发生这种冲突。
我从这个冲突中得到的错误是:
Uncaught TypeError: undefined is not a function
【问题讨论】:
-
为什么要加载 jQuery 两次?版本几乎相同。
-
不要加载 jQuery 两次...简单。仅使用
1.11.1版本。