3

で動作するソーシャルネットワーク用のアプリを開発していIFrameます。このアプリは、Google Chrome および Microsoft Firefox ブラウザーでは問題なく動作しますが、Opera 12.15 JQuery ライブラリ v1.10.1 ではUnhandled error: Security error: attempted to read protected variable、行1513のセキュリティ エラーで読み込みに失敗します。

スクリーンショットは次のとおりです。

スクリーンショット

Internet Explorer 10 にも同じバグが存在するようです。

それに対処する方法は?

アップデート:

jqueryのコードの1513 ~ 1517行にコメントを付けて、汚いハックを作成しました。

   // Support: IE>8
   // If iframe document is assigned to "document" variable and if iframe has been reloaded,
   // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
  /*if ( parent && parent.frameElement ) {
        parent.attachEvent( "onbeforeunload", function() {
            setDocument();
        });
    }*/

私のアプリの機能は現在動作しているようですが、おそらく JQuery リポジトリで問題を作成する必要があります...

4

2 に答える 2

0

JQuery を含める前にこれを追加します。

var isIE11 = !!(navigator.userAgent.match(/Trident/) && !navigator.userAgent.match(/MSIE/));
if (isIE11) {
    if (typeof window.attachEvent == "undefined" || !window.attachEvent) {
        window.attachEvent = window.addEventListener;
    }
}

それが役に立てば幸いです、それは私のために働いた.

于 2015-08-05T18:32:20.190 に答える