Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SCRIPT5: Access is denied in IE9 on xmlhttprequest

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?

like image 643
Eric L Avatar asked Apr 26 '11 17:04

Eric L


2 Answers

Maybe you like to check the links below:

  • Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest
  • XMLHttpRequest – Mozilla Developer Network
  • A good summary of the jQuery x-domain requests
  • Which browser supports x-domain?
like image 80
Horst Walter Avatar answered Oct 09 '22 08:10

Horst Walter


You likely have a Mark-of-the-Web on the local file. See http://blogs.msdn.com/b/ieinternals/archive/2011/03/23/understanding-local-machine-zone-lockdown-restricted-this-webpage-from-running-scripts-or-activex-controls.aspx for an explanation.

like image 31
EricLaw Avatar answered Oct 09 '22 10:10

EricLaw