Hello guys, tried googling or searching in this forum but it will still not work. This code works perfectly fine in IE but not in firefox. Here's the AJAX code:
function search()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","search.php",true);
xmlhttp.send();
}
This is search.php
<?php
echo "hey";
?>
I've spent 2 hours on this. I would really appreciate it if you guys can tell me what the problem is