title: How to get data from ajax.done()?
body: <p>I have the following function:</p>
  
  <pre><code>$.ajax({
      url: "../../getposts.php"
  }).done(function(posts) { 
      var postsjson = $.parseJSON(posts);
  });
  </code></pre>
  
  <p>How do I use the variable <code>postsjson</code> outside the <code>.done()</code> function, or how do I declare it global?</p>
  
  <p>I can't pass it to another function, because I want to use the array later on, and not when the ajax is completed.</p>