0

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

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by almostbob
0

Hi Whilliam,

I have checked it in IE and firefox. It works fine here. What firefox version are you using? And do you have any other javascript code exists in that page other than the search function?

0

hello, sorry for the late reply. The firefox version was 1.something. I tried testing it in newer version of firefox and it worked well.

0

Old versions of firefox had a proprietary dom, new versions have a simliar dom to IE safari, just a way better implementation than IE

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.