title: Testing JSON with PHP
body: <p>JSON newbie trying to get a grasp on this. My page is not alerting anything. What is wrong here?</p>
  
  <p>The name of this page is test.php.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;test&lt;/TITLE&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
  
  
  &lt;/HEAD&gt;
  
  &lt;?php 
  
   $arr = array ('item1'=&gt;"test1",'item2'=&gt;"test2",'item3'=&gt;"test3");      
   $test = json_encode($arr);
   echo $test;
  
  ?&gt;
  </code></pre>
  
  <p>   </p>
  
  <pre><code>$(function() { 
     $.getJSON('test.php',function(data) {   
  
      alert("Testing Data Item1 , its value is: &gt;" + data.item1 + "&lt;"); 
  
             $.each(data,function(i, item) {     
      alert(item.key);       
              });    
          }); 
      });  
  &lt;/script&gt; 
  </code></pre>
  
  <p>
  </p>