1

IE9上のCLEditorでdocument.domainを使用するときに問題があります。私がdocument.domainを追加すると、エラーメッセージ "SCRIPT5:Access is denied"が表示されます。 Firefoxでうまく動作し、document.domainを削除してもうまく動作します。私はまだクロスサブドメインiframeを使用せず、すべてのiframeが同じドメインにあります。IE9:セットアップ時にアクセスが拒否されました。document.domain

document.domainを削除せずに修正するにはどうすればよいですか?

<script type="text/javascript" src="jquery-1.7.1.min.js"></script> 
    <script type="text/javascript"> 
    document.domain = 'mydomain.com'; 
    </script> 
    <script type="text/javascript" src="jquery.cleditor.js"></script> 

ここでエラーがapears CLEditorコードの一部です:ここで

 // Create a new iframe 
    var $frame = editor.$frame = $('<iframe frameborder="0" src="javascript:true;" id="iframe">') 
     .hide() 
     .appendTo($main); 

    // Load the iframe document content 
    var contentWindow = $frame[0].contentWindow, 
     doc = editor.doc = contentWindow.document,  // here is the error message 
     $doc = $(doc); 

はCLEditorの完全なソースコードです: http://premiumsoftware.net/cleditor/jquery.cleditor.jsここ

はIセットアップdocument.domainをがどのようです

答えて

0

document.domainを使用するには、通信の両側で同じ文字列に設定する必要があります。ここでは、 iFrameと親の両方で設定します。

+1

私はまだ異なるサブドメインでiframeを使用し始めませんでした。 iFrameと親は同じサブドメインにあります。両方とも同じドメインと同じページにあります。私はIE9はiFrameが次のようにJavaScriptによって作成された場合、通信が許可されないと思います:var $ frame = editor。$ frame = $( '