|
onreadystatechange NOT working in IE!!!!
hello. i have a script that loads content into a div. it works in firefox but not IE. i have debugged and determined where it stops working, i just don't know why it ain't working. here is the code:
- Code: Select all
function ajaxpage(url, containerid){
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
// stops working here
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
//alert('test');
}
page_request.open('GET', url, true)
page_request.send(null)
}
can anybody provide a solution please.
thanks in advance
Last edited by Rakuli; Jan 18th, 2008 at 09:15.
Reason: wraped some [code] tags around it and removed completely unnecessary links
|