title: Search through JSON file and show results with jquery
body: <p>This is my search.html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  &lt;script src="search.js"&gt;&lt;/script&gt;
   &lt;LINK href="map.css" rel="stylesheet" type="text/css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input id="searchterm" type="text" /&gt; &lt;button id="search"&gt;search&lt;/button&gt;
  &lt;div id="results"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;script type="application/javascript" src="search.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This is my search.js:</p>
  
  <pre><code>      $("#searchterm").keyup(function(e){
      var q = $("#searchterm").val();
      $.getJSON("http://hello.com/mydata.json",
      {
        srsearch: q,
        action: "query",
        list: "search",
        format: "json"
      },
      function(data) {
        $("#results").empty();
        $("#results").append("&lt;p&gt;Results for &lt;b&gt;" + q + "&lt;/b&gt;&lt;/p&gt;");
        $.each(data.query.search, function(i, item){
          $("#results").append(item.name);
        });
      });
    });
  </code></pre>
  
  <p>I want the results show up on the page. It should look through the JSON file and then return the name of the item(s) found in the JSON search. Each object in the JSON file has a property of name.</p>
  
  <p>I get this error: </p>
  
  <p>TypeError: data.query is undefined
  $.each(data.query.search, function(i, item){</p>