E
Elizabeth.Lattanzio
Hi all,
So I've been searching the various forums out there for an answer to
this problem, but their seem to be multiple versions. I am using the
getElementById function in my ajax and though it works fine in
firefox, it returns the following error in Internet Explorer:
'document.getElementById(...)' is null or not an object.
Now one post said its because I.E. is not case sensitive, so I made it
all lower case and nothing. Don't know what else the problem might
be, but here is the code:
////
function getMenu(){
xmlHTTP2=GetXmlHttpObject();
if (xmlHTTP==null){
alert ("Your browser does not support AJAX!");
return;
}
url2= "GEPmenu.html";
xmlHTTP2.onreadystatechange=menuPrint;
xmlHTTP2.open("GET",url2,true);
xmlHTTP2.send(null);
}
function menuPrint(){
if (xmlHTTP2.readyState == 4) {
if (xmlHTTP2.status == 200) {
xmldoc2 = xmlHTTP2.responseText;
document.getElementById("menutable").innerHTML = xmldoc2; ///This
is the problem line
} else {
alert('There was a problem with the request.');
}
}
}
///
///This should be changing the contents of the following table in my
html (I thought maybe it was a table quirk, but also tried it with a
div... No go.):
<table width="170" border="1"
cellpadding="5" cellspacing="0"
bordercolor="#CCCCCC" bgcolor="#CC3333" id =
"menutable">
</table>
Any answers?
Thanks,
Liz
So I've been searching the various forums out there for an answer to
this problem, but their seem to be multiple versions. I am using the
getElementById function in my ajax and though it works fine in
firefox, it returns the following error in Internet Explorer:
'document.getElementById(...)' is null or not an object.
Now one post said its because I.E. is not case sensitive, so I made it
all lower case and nothing. Don't know what else the problem might
be, but here is the code:
////
function getMenu(){
xmlHTTP2=GetXmlHttpObject();
if (xmlHTTP==null){
alert ("Your browser does not support AJAX!");
return;
}
url2= "GEPmenu.html";
xmlHTTP2.onreadystatechange=menuPrint;
xmlHTTP2.open("GET",url2,true);
xmlHTTP2.send(null);
}
function menuPrint(){
if (xmlHTTP2.readyState == 4) {
if (xmlHTTP2.status == 200) {
xmldoc2 = xmlHTTP2.responseText;
document.getElementById("menutable").innerHTML = xmldoc2; ///This
is the problem line
} else {
alert('There was a problem with the request.');
}
}
}
///
///This should be changing the contents of the following table in my
html (I thought maybe it was a table quirk, but also tried it with a
div... No go.):
<table width="170" border="1"
cellpadding="5" cellspacing="0"
bordercolor="#CCCCCC" bgcolor="#CC3333" id =
"menutable">
</table>
Any answers?
Thanks,
Liz