本地主机中的IE跨域Ajax请求
我有一台运行在本地主机端口3002上的服务器,当我尝试从本地主机端口3000发送ajax请求时,该请求未在任何版本的Internet Explorer中发送.(在chrome和firefox中可以正常工作).我也尝试过使用jquery插件jquery.xdomainajax.js,而且我也有
I have a server running in localhost port 3002 and when i try to send an ajax request from localhost port 3000, the request is not sent in any version of Internet explorer.(Works fine in chrome and firefox). I have also tried using jquery plugin jquery.xdomainajax.js and also i have
def set_access_control_headers headers ['Access-Control-Allow-Origin'] ='' headers ['Access-Control-Request-Method'] ='' 结束
def set_access_control_headers headers['Access-Control-Allow-Origin'] = '' headers['Access-Control-Request-Method'] = '' end
应用程序控制器中在本地主机端口3002中运行的服务器的代码中的方法.
method in application controller in code of server running in localhost port 3002.
我的要求:在IE中跨域发送ajax请求并处理响应. 任何帮助都将得到高度重视.
My requirement: Send an ajax request cross-domain in IE and handle the response. Any help would be highly appriciated.
预先感谢
IE disables access to data sources across domains by default in some versions: http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx#xdomain
在"Internet选项"中,转到安全性",然后单击自定义级别..."按钮.该设置在其他"部分的列表底部附近:跨域访问数据源"
In Internet Options, go to Security and click on the "Custom Level..." button. The setting is near the bottom of the list in the Miscellaneous section: "Access data sources across domains"
在Intranet环境中遇到此问题之前,我可以禁用该设置并通过组策略将其推送给用户,但是我确定对于Internet应用程序,您希望找到一个更好的解决方法.
Before I have run into this in an intranet environment where I can disable the setting and push to users via group policy, but I'm sure for an internet app you'd want to find a better workaround.