微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

访问被拒绝.在IE中的jquery.form.js

我该如何解决这个问题?
IE上的访问被拒绝:( jquery.form.js)

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

解决方法

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

However this issue has been documented

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

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时会出现安全异常.

快速修复/破解(如果在try块内调用则移动):

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

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐