
Originally Posted by
thetestingsite
I don't think AJAX works in IE7 on localhost. That could be the reason why you get an error.
Hope this helps.
Right. But, it can if that is what you need it to do, change:
Code:
function ajaxpage(url, containerid, targetobj){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
to:
Code:
function ajaxpage(url, containerid, targetobj){
var page_request = false
if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else
return false
I think you can see what's happening here which is - IE 7 now supports window.XMLHttpRequest but, not locally while, it still supports window.ActiveXObject locally (with permission).
Bookmarks