Search code examples
javascriptajaxinternet-explorerinternet-explorer-8xdomainrequest

Cross-Site XmlHttp (XDomainRequest)


I'm writing a web-based tool for my company and it is running off the local intranet and running in IE8. I believe since the company computers are in a SOE, nobody has control over the browser settings except the IT department and they will be unlikely to make any changes, at least not in the timeframe we need it.

I have an XmlHTTP request to a URL which is in "Trusted Sites" (also on the local intranet), but when I send the request, I get an exception: "Access is denied", and when I catch the exception and output it to my page, I get "TypeError: Access is denied".

Is there any way I can get IE8 to complete this AJAX request?

Edit: Upon further researching, it turns out that the problem may not have anything to do with trusted sites/local intranet after all. Apparenly you can't do cross-domain XmlHttp requests. My system is accessed by an IP address, whereas the target site of my AJAX script is (still local) a domain, which resolves to a different IP address. Unfortunately I've already tried writing a PHP script which will get the page from the server-end, however it also refuses to connect without a username/password.

At this stage I'm open to any hacky suggestions on how to get around this. If I can get this function to work, it will save us days of manually inputting data.


Solution

  • Since IE8 does not support CORS you either have to do a proxy or make the request with JSONP or get everything under the same IP.