在客户端上,我有:
<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在iFrame中打开页面。您将必须关闭proxy.html的“X-Frame-Options” header ,然后它应该可以工作。