title: Ajax call to PHP is returning nothing
body: <p>I'm trying to make my first ajax example working on my MAMP.
  my ajax.html looks like:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src='ajax.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload = 'ajax()'&gt;
  &lt;div id='test'&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my ajax.js looks like:</p>
  
  <pre>
  
  function ajax()
  {
  >>var xmlhttp;<br>if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
  else
    {// code for IE6, IE5<br>
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.open("GET","http://localhost:8888/ajax.php",true);
  xmlhttp.send();
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
      {
      document.getElementById("test").innerHTML=xmlhttp.responseText;
      }
    }
  }
  </pre>
  
  <p>my ajax.php looks like:</p>
  
  <blockquote>
    <p>echo 'hello world';</p>
  </blockquote>
  
  <p>I detected response header from firebug:</p>
  
  <blockquote>
    <p>Response Headers<br>
    Connection  Keep-Alive<br>
    Content-Length  11<br>
    Content-Type    text/html<br>
    Date    Mon, 05 Nov 2012 18:57:46 GMT<br>
    Keep-Alive  timeout=5, max=99<br>
    Server  Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8r DAV/2 PHP/5.4.4<br>
    X-Pad   avoid browser bug<br>
    X-Powered-By    PHP/5.4.4<br></p>
  </blockquote>
  
  <p>but nothing in response text and nothing changed in my html.</p>
  
  <p>Anyone could help me out please?</p>
  
  <p>Thanks!</p>