jQuery .Noconflict问题

问题描述:

我有一个我无法解决的问题,这使我发疯.我正在使用jQuery库,并且正在使用".noconflict".

I have a problem that I just cannot resolve and its driving me insane. I am using the jQuery library and I am using ".noconflict".

我正在尝试通过以下脚本在我的博客上使用它-

I am trying to use this on my blog with the following script -

http://www.internetmarketingmonitor.org/word -press-plugins/imm-glossary-wordpress-plugin

问题是-我不断收到以下错误-

The problem is - I keep getting the following error -

>  [Exception... "Component returned failure code: 0x80070057
> (NS_ERROR_ILLEGAL_VALUE) [nsIDOMXPathEvaluator.evaluate]"  nsresult:
> "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame ::http://myblog.com/wp-content/plugins/IMM-Glossary/JavaScripts/prototype.js
> :: anonymous :: line 1081"  data: no]
> Source:http://myblog.com/wp-content/plugins/IMM-Glossary/JavaScripts/prototype.js

我正在使用.NOCONFLICT吗?是没有意义的-通过简单地下载此插件并将* .js与jquery放在同一页面上就可以轻松地复制该错误?

What's not making sense is that I AM USING .NOCONFLICT? - The error can be easily replicated by simply downloading this plugin and putting the *.js on the same page as jquery?

任何人都可以提供帮助吗?

Would anyone be able to help ?

我查看了源代码,但现在页面上没有jQuery.

I looked at the source, but don't see jQuery on the page right now.

根据您对原始问题的评论,听起来您没有积极启动noConflict函数.您需要做与此类似的事情.

Based on your comment to your original question, it sounds like you're not actively kicking off the noConflict function. You need to do something akin to this.

<script type="text/javascript" src="path/to/jquery.js"></script>
<script type="text/javascript">
    jQuery.noConflict();
</script>

您会注意到对jQuery.noConflict的调用不是 not 包装在任何形式的DOM就绪检查中.为了安全起见,您希望在包含jQuery之后立即运行它.

You'll note the call to jQuery.noConflict is not wrapped in any sort of DOM ready check. You want to run it immediately after you include jQuery to be safe.