jQuery 1.4.2 IE 7.0 permission denial error
Recently switched to use core 1.4.2, and found that sometimes on XP IE7.0, I will get permission denied error when using ajax call, and the debug traced it to the following function:
xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
function() {
return new window.XMLHttpRequest();
} :
function() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {}
},
If I revert this function back to its previous in 1.3.2:
xhr:function(){
return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
},
The permission denial error will go away.
I know there must be reasons for the change from 1.3.2 to 1.4.2 for the core function. Just let you know that there is a specific issue on IE 7.0 for this case. (It is not happening for all the ajax calls on all my pages, it just happen for certain pages, and the strange thing is it only happens at the first time I reach the page, if I refresh the page, the error will go away. However, by overwrite that function with its old version from 1.3.2, it resolved my problem).