0

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'] = '' end

method in application controller in code of server running in localhost port 3002.

My requirement: Send an ajax request cross-domain in IE and handle the response. Any help would be highly appriciated.

Thanks in advance

Satya Kalluri
  • 5,148
  • 4
  • 28
  • 37

1 Answers1

0

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

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"

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.

  • Thanks for the clarification @numbersnelson. I am looking for an internet app and am at loss of solutions. Can you suggest any workaround for this problem? – Satya Kalluri Mar 21 '12 at 06:03
  • Have you tried setting up some sort of proxy request? Maybe if your ajax call was requesting a local (within the same domain) resource, but you can have that local resource being the one reaching across to the other domain. This way, the browser isn't the one requesting something from another domain, so maybe that would not make the security setting apply. – numbersnelson Mar 29 '12 at 17:31