I'm using following code in one of my JavaScript file.
xhr = new XMLHttpRequest();
xhr.open("GET", dest, true); // dest is the URL
xhr.onreadystatechange = checkData;
xhr.send(null);
But when I run the script in IE,m it is giving me following error.
SCRIPT5: Access is denied.
Then I thought to check the browser type and execute a separate code for IE like below.
if(isIE){
xhr = new XDomainRequest();
xhr.onerror = function (res) { alert("error: " + res); };
xhr.ontimeout = function (res) { alert("timeout: " + res); };
xhr.onprogress = function (res) { alert("on progress: " + res); };
xhr.onload = function (res) { alert("on load: " + res); };
xhr.timeout = 5000;
xhr.open("get", dest); // Error line
xhr.send(json);
}
But again it is giving me the same error where I have used following code
xhr.open("get", dest);
At the end I want to call checkData
function like I have done below with other browsers.
xhr.onreadystatechange = checkData;
What have I missing there to get Access Denied error at the IE console?