I need to make a GET request to a remote Domain Name (also controlled by me) but can't use jQuery. I am using old fashioned JS. I am aware that XDomainRequest should be used for IE8/9 but despite the code catering for this I am still getting an "Access is denied" error. Works fine on newer versions of IE and other browsers.
if (window.XDomainRequest) xhr = new XDomainRequest();
else if (window.XMLHttpRequest) xhr = new XMLHttpRequest();
else xhr = new ActiveXObject("Microsoft.XMLHTTP");
xhr.open("GET", "https://www.remote-domain-name.com/index.php?"+params, true);
Do I need to change the JS for my request or perhaps I need to change the header that is returned by remote-domain-name.com/index.php. This is currently set to:
header('Access-Control-Allow-Origin: *');