访问被拒绝。在IE中的jquery.form.js [英] Access is denied. on jquery.form.js in IE

查看:503
本文介绍了访问被拒绝。在IE中的jquery.form.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决此问题?
IE拒绝访问:(jquery.form.js)

How do I resolve this problem? Access denied on IE:(jquery.form.js)

 =>   if (io.contentWindow.document.execCommand) {
        try { // #214
            io.contentWindow.document.execCommand('Stop');
        } catch(ignore) {}
    }


推荐答案

我今天遇到了同样的问题。

I was hit by the same problem today.

但是这个问题已经记录在案了

问题是IE9中的代码被破坏了。
来自该链接的评论者解释了问题:

The problem is that the code is broken in IE9. On of the commenters from the link explains the problem:


这是因为IE友好错误消息功能 。对于HTTP 4xx和5xx响应,IE用其友好的错误消息替换IFRAME的内容,这样做会改变帧的域。当插件尝试访问响应文档时,由于同源策略失败,导致插件将请求视为中止

This happens because of the IE "friendly error messages" "feature". For HTTP 4xx and 5xx responses IE replaces the content of the IFRAME with its friendly error message and in so doing changes the domain of the frame. When the plugin tries to access the response document it fails due to the same-origin policy, which causes the plugin to treat the request as aborted

由于这个安全限制,IE js解释器从访问io.contentWindow.document的那一刻开始就出现安全异常。

Due to this security restriction the IE js interpreter barfs a security exception from the moment io.contentWindow.document is accessed.

快速修复/黑客(如果调用内部移动)尝试阻止):

quick fix/hack (moved if call inside try block):

try { // #214
  if (io.contentWindow.document.execCommand) 
   io.contentWindow.document.execCommand('Stop');
} catch (ignore) { }

我在生产中有这个修复,但我没有在IE8 / IE9中发现任何负面影响

I have this fix in production and I did not find any negative side effects in IE8/IE9

这篇关于访问被拒绝。在IE中的jquery.form.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆