title: load json from file into object
body: <p>Struggling to load json from file (myData.json) on URL into an object so I can access property values. </p>
  
  <p>-- The data loads immediately, I need it a lot in the app.</p>
  
  <p>-- I'm going to access the data throughout the app, not just as part of one function that happens immediately after the data loads.</p>
  
  <p>-- I've ensured the data in my file is properly formatted json. </p>
  
  <p>Following the example on the jquery API, shouldn't I be able to do something simple like:</p>
  
  <p>alert(jqxhr.myProperty);</p>
  
  <p>and get the value? <em>What step am I missing here?</em> I've tried running eval and a variety of things like </p>
  
  <p>var myObj=JSON.parse(jqxhr);</p>
  
  <p>to no avail.</p>
  
  <p>Please....thank you.</p>
  
  <pre><code>// Assign handlers immediately after making the request,
  // and remember the jqxhr object for this request
  var jqxhr = $.getJSON("example.json", function() {
    alert("success");
  })
  .success(function() { alert("second success"); })
  .error(function() { alert("error"); })
  .complete(function() { alert("complete"); });
  
  // perform other work here ...
  
  // Set another completion function for the request above
  jqxhr.complete(function(){ alert("second complete"); });
  </code></pre>