Hi,
I m confused about following ajax code. Where is the problem? Working good on IE but not on FireFox?
Please sort it out.
Thanx in advance.
I m confused about following ajax code. Where is the problem? Working good on IE but not on FireFox?
Please sort it out.
Code:
<script type="text/javascript">
function loadXMLDoc()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML="hello";
}
}
xmlhttp.open("GET","index.aspx?id=abc",true);
xmlhttp.send();
}
</script>
Comment