3

i simply need to load a cross-domain asp.net page using jQuery's load() function, but this page can trigger a redirect (i have access to both Server and Client pages).

The loaded page is an asp.net page and i use from server:

Response.Redirect("http://www.google.it")

but chrome cancels the redirect request. I already googled a lot about this and lot of people say "use CORS", i can't because cors are not supported on IE7 and i need to support that browser.

I tried with Custom Headers but seems like i can't read those from a cross domain, even if the server have this in web.config:

  <customHeaders>
    <add name="Access-Control-Allow-Headers" value="*" />
    <add name="Access-Control-Allow-Origin" value="http://10.0.0.158" />
    <add name="Access-Control-Allow-Methods" value="*" />
    <add name="Access-Control-Allow-Credentials" value="true" />
    <add name="Access-Control-Expose-Headers" value="*"/>
  </customHeaders>

Yes, http://10.0.0.158 is my local "client page" ip. After some googling i read about easyXDM libraries but i'm still not sure they can do the trick. Can i use those? How? Have i other alternatives?

Ps: i get the header with this:

jQuery('body').bind('ajaxSuccess',function(event,request,settings){
                console.log("ajaxSuccess triggered: "+request.getAllResponseHeaders());
});

and it writes only this:

Content-Type: text/html; charset=utf-8
Cache-Control: private

with fiddler the header is a lot bigger with all my custom headers.

HypeZ
  • 4,017
  • 3
  • 19
  • 34

0 Answers0