使用jquery 1.9.1的Firefox附加组件错误

时间:2013-02-19 22:49:49

标签: jquery firefox firefox-addon

将Firefox 18与Jetpack SDK一起使用。在我的页面中注入jquery-1.9.1.js后,我在控制台中收到以下错误:

Traceback (most recent call last):
  File "resource://jid1-t5mdaatmx3urka-at-jetpack/yesware/data/jquery.min.js", line 9597, in 
    })( window );
  File "resource://jid1-t5mdaatmx3urka-at-jetpack/yesware/data/jquery.min.js", line 1307, in 
    jQuery.support = (function() {
  File "resource://jid1-t5mdaatmx3urka-at-jetpack/yesware/data/jquery.min.js", line 1446, in jQuery.support<
    support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
TypeError: div.attributes[eventName] is undefined

我在jQuery的开发版本中查找了它,第1446行引用了这个块:

     // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
    // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
    for ( i in { submit: true, change: true, focusin: true }) {
        div.setAttribute( eventName = "on" + i, "t" );

        support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
    }

它表示要注意CSP限制,但Firefox开发网站并没有告诉我太多。我该怎么办?

顺便说一句,如果我把这个块从jquery中取出来,一切正常。当然,我不喜欢弄乱我不完全理解的事情。

0 个答案:

没有答案