title: Using Jquery to get JSON objects from local file
body: <p>I'm trying to get a list of JSON objects (products) from a local file using Jquery and store all the objects in a single array called allItems.  The file is co-located in the same directory as the code, and it's called "allItems.json".  Here's how I'm doing it now:</p>
  
  <pre><code>function getAllSupportedItems(){
      var allItems = new Array();
      $.getJSON("allItems.json",
           function(data){
               $.each(data.items, 
               function(item){
                   allItems.push(item);
               });
           });
      return allItems;
  }
  </code></pre>
  
  <p>Based on this example: <a href="http://api.jquery.com/jQuery.getJSON/" rel="noreferrer">http://api.jquery.com/jQuery.getJSON/</a></p>