title: Why doesn’t my $getjson call working?
body: <p>I’m relatively new to this php and I’m attempting to access/execute a php file from my javascript file and have it appear in my html. I was told $getjson is the best way to do that but I do not see my php script past backed into my html:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;div class="button"&gt;&lt;/div&gt;
      &lt;script src="http://code.jquery.com/jquery-1.7.js"&gt;&lt;/script&gt;
      &lt;script src="Test.js" type="text/javascript"&gt;&lt;/script&gt; 
  &lt;/head&gt;
  &lt;body&gt;
       &lt;a href="#" id="getdata-button"&gt;Get JSON Data&lt;/a&gt;
      &lt;div id="showdata"&gt;&lt;/div&gt;
  &lt;/body&gt; 
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>$(document).ready(function(){
      $( document ).on("click","#getdata-button", function() {
      //test Confirmed
      alert('hello8');
         $.getJSON('Test.php', function(data) {
              //noresponse
              alert('hello5');
              $('#showdata').html("item1="+data.item1+" item2="+data.item2+" item3="+data.item3+"");
          });
      });
  });
  </code></pre>
  
  <p>Test.php:</p>
  
  <pre><code>    &lt; ?php
  $items = array( 
    'item1' =&gt; 'I love jquery4u',
    'item2' =&gt; 'You love jQuery4u',
    'item3' =&gt; 'We love jQuery4u'
  );
  
  header('Content-type: application/json');
  echo json_encode($items);
  
  ?&gt;
  </code></pre>
  
  <p>My expected result is to item1/item2/item3 in the html.</p>