title: Simple jQuery-Ajax-PHP example
body: <p>I've been looking at a few introductory examples of how to use ajax with jQuery but when I try those examples on my server, they don't seem to work.</p>
  
  <p>Here is the code I have in the html file:</p>
  
  <p></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="jquery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(function(){
      $.get("ajax/json-statistics.php", function(data){
          alert("hello");});
  });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's the code I have in the PHP file:</p>
  
  <pre><code>&lt;?php
  $arr = array('a' =&gt; 1, 'b' =&gt; 2, 'c' =&gt; 3, 'd' =&gt; 4, 'e' =&gt; 5);
  echo json_encode($arr);
  ?&gt;
  </code></pre>
  
  <p>Both files are located in the same directory. When I go to the html page, it's just blank but I'm expecting an alert box to appear containing the text hello.</p>