2

I have a javascript file that is supposed to be loaded on different client websites as a service. There are some AJAX post requests in this file which calls the backend on my server. It usually works fine in chrome and firefox but IE always shows "Access is denied". I have tried using "Acces control allow origin '*', but that doesnt solve the problem. I know there is one possible solution of using XDomainRequests. I wanted to know if there is any other solution to this problem?

Cerberus
  • 21
  • 1

1 Answers1

0

In IE8 and 9 you need to make use of the XDomainRequest object. It has more or less the same API as XMLHttpRequest, minus the onreadystatechange property. AFAIK IE10 supports the standard CORS process but retains XDomainRequest for compatibility.

You must also make sure the AJAX URI you're calling has the same encryption scheme as the page: i.e. if you served it over https, the call must be over https, if not, it must be sent in the clear.

Chris Mowforth
  • 6,689
  • 2
  • 26
  • 36