2

将 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 中取出,一切都会很好。当然,我不喜欢搞乱我不完全理解的事情。

4

0 回答 0