Internet Explorer中跨站点请求的访问控制 [英] Access control for cross site requests in Internet Explorer
问题描述
我正在尝试从几个域进行AJAX调用,一个将处理请求。通过在处理服务器上设置标头,可以轻松在Firefox和Chrome中启用跨网域:
I am trying to make an AJAX call from several domains to a single one which will handle the request. Enabling Cross domain in Firefox and Chrome was easy by setting the header on the handling server:
header("Access-Control-Allow-Origin: *");
但这并不能帮助在Internet Explorer中启用它。当我尝试:
But this doesn't help enabling it in Internet Explorer. When I try:
httpreq.send('');
它停止时出错访问被拒绝。
it stops with error Access denied.
如何在Internet Explorer中启用?
How can this be enabled in Internet Explorer?
推荐答案
我不相信你可以直接在Internet Explorer中执行。您有以下两种选择:
I don't believe you can do that directly in Internet Explorer. You have a couple of options:
-
在您控制的服务器上设置代理转发脚本, 。
Set up a proxy forwarding script on the server you do control that can forward the Ajax requests. Make sure that it only forwards to the appropriate destinations that you need so that you don't get turned into an anonymous relay.
使用<$ c $
这篇关于Internet Explorer中跨站点请求的访问控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!