views:

1492

answers:

5

Hi,

I'm loading a page through AJAX with jQuery's load() function. It doesn't work in IE8, giving the "permission denied" error. Using the IE debugger, it seems that when jQuery tries to open up the xhr, ie blocks it.

The problem is, my page has a javascript src that points to bing maps js api (which of course is in a completely different domain than mine). It seems to me that IE tries to grab this js file through a xhr, which then throws the "permission denied" error. Is there a workaround for this?

I can only remember of downloading the bing maps js myself and serving them locally.

A: 

You could include the script tag to the Bing Maps API in the parent document (the one making the jQuery load() call).

Michael Wales
I do not control the parent document.
Miguel Ping
A: 

I have the same problem. I am trying to load a html page with this. It works fine in al other browsers

Harry
A: 

I eventually grabbed a copy of the script and include it myself, so it is in the same domain.

Miguel Ping
A: 

I have a similar problem with IE 7 using jQuery ajax, get permission denied on the line: return new A.XMLHttpRequest. The request is within the same domain and works on other browser as well. And it failed the first time I get to the page, if I refresh the page and use the ajax again, it will ok. No idea what happens.

Shaw Zhang
+1  A: 

I did more test on this. And seems the error was caused by invalid HTML structures on the page. As it is a very complicated page, there are mismatched open <div> or <table> on the page, as when I shorten the page to bare minimum, it works on IE as well. But I don't understand why it was not working when you get to the page first time, and if you refresh the page, it will work after that.

Shaw Zhang