Alex Rivera | Logout

SCRIPT5: Access is denied in IE9 on xmlhttprequest

Asked 2011-04-26T17:06:03.460
47
var xhttp=new XMLHttpRequest();
xhttp.open('GET', 'foo.xml', false);

F12 pops back: SCRIPT5: Access is denied. on Line 95, which is the xhttp.open line.

My JavaScript seems well-formed, and Firefox does what I think it should.

I've read a lot of questions very similar to this one, so I've checked out the Same Origin Policy, but I can't see how it'd apply considering foo.xml is in the same directory as the html file. I opened up the scripting permissions on my local intranet, and told McAfee to take a five-minute break, just to be sure. I even tried running IE as admin, so this can't really be a permissions issue can it? Why else would IE be denied access to a local file?

Edit
Report

2 Answers

1

Most likely, you need to have the Javascript served over SSL.

Source: https://www.parse.com/questions/internet-explorer-and-the-javascript-sdk

answered 2012-12-02T23:18:23.710
0

I had faced similar issue on IE10. I had a workaround by using the jQuery ajax request to retrieve data:

$.ajax({
    url: YOUR_XML_FILE
    aync: false,
    success: function (data) {   
        // Store data into a variable
    },
    dataType: YOUR_DATA_TYPE,
    complete: ON_COMPLETE_FUNCTION_CALL
});
answered 2013-07-20T05:04:36.887

Your Answer