I don't know what happened to my previous topic about this.
But I am using an AJAX menu on a page I am making for somebody, and I used the exact same code w3schools recommends to use:
function updatemenu(leagueno, confno, location, mode)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="updatemenu.php";
url=url+"?mode="+mode+"&leagueno="+leagueno+"&confno="+confno+"&loc="+location;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("results").innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
It works flawlessly in Firefox, Safari, etc., (any browser that adheres to standards), but Internet Explorer doesn't load it, and it gives an error. And in fact, it says the error is on line 169, but the page isn't that many lines long, so I can't find where it is. I'm sure it's on statechanged or one of the xmlHttp=new ActiveXObject lines.
But this is the code w3schools says to use, so I don't know why it's not working.
Any ideas?
Thanks