javascript - 我在客户端和服务器端都实现了 xdomain 脚本,但在 IE9 中不断收到 'Timeout waiting on iframe socket' 警告

标签 javascript sockets iframe internet-explorer-9 xdomainrequest

在客户端,我有:

<script src="js/plugins/xdomain.min.js" slave="https://api/proxy.html"></script>

然后在服务器上,我有一个 proxy.html:

<!DOCTYPE HTML>
<script src="js/xdomain.min.js"></script>
<script>
  xdomain.masters({
    "https://*.localhost" : '/.*/',
    "https://*.host.net" : '/.*/'
  });
</script>

在 IE9 的开发工具中,我有 xdomain 日志记录:

 'proxying request to slave:'
 'new socket:'
 'Timeout waiting on iframe socket'

我没有看到任何数据传递给客户端 - 即我的 Controller 中的模型是空的。

最佳答案

您应该在浏览器中打开您的 proxy.html 并查看它是否正在发送“X-Frame-Options” header ,如果是,这将阻止 IE9 在 iF​​rame 中打开页面。您必须关闭 proxy.html 的“X-Frame-Options” header ,然后它才能正常工作。

关于javascript - 我在客户端和服务器端都实现了 xdomain 脚本,但在 IE9 中不断收到 'Timeout waiting on iframe socket' 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23619734/

相关文章:

javascript - 将变量传递给 :eq jquery selector in a while loop

c# - 在Unity3D中无法接收来自PLC的C#UDP消息,但在Wireshark中可见

php - 如何停止在另一个页面中执行 php 脚本?

javascript - 我可以对 JavaScript 施加时间限制(例如使用 iframe)吗?

css - 为什么 iframe 默认是内联元素?

javascript - 可能/如何在鼠标焦点上调整 iframe 大小?

javascript - 如何在 AngularJS 上创建模块/插件

javascript - 我想打破文本框的值

javascript - 将参数传递给node.js中的路由

c# - 如何从 Socket 获取 IP 地址