title: jQuery: Is it possible to use a getJSON request inside another getJSON request?
body: <p>Is it possible to use a getJSON request inside another getJSON request, using jQuery?</p>
  
  <p>Something like this:</p>
  
  <pre><code>// Population the Requests List
  // jQuery AJAX call for JSON
  $.getJSON( '/workspace/friends/sentRequests', function( data ) {
      // For each item in our JSON, add a table row and cells to the content string
      $.each(data, function(){
          //Loading each user data into global variable.
          $.getJSON( '/workspace/friends/' + this.friendId, function( user ) {
              requestListData.push(user);
          });
  
          requestTableContent += '&lt;tr&gt;';
          requestTableContent += '&lt;td&gt;&lt;a href="#" class="linkshowuser btn btn-info btn-xs"" rel="' + this.friendId + '" title="Show Details"&gt;' + this.name + '&lt;/td&gt;';
          requestTableContent += '&lt;td&gt;&lt;a href="mailto:' + this.email + '"&gt;' + this.email + '&lt;/a&gt;&lt;/td&gt;';
          requestTableContent += '&lt;td&gt;' + moment(useListData[-1].activity.date_established).format('MMMM Do YYYY') + '&lt;/td&gt;';
          requestTableContent += '&lt;td&gt;' + this.gender + '&lt;/td&gt;';
          requestTableContent += '&lt;td&gt;&lt;a href="#" class="linkdeleteuser btn btn-danger btn-xs" rel="' + this.email + '"&gt;Danger!&lt;/a&gt;&lt;/td&gt;';
      });
  
      // Inject the whole content string into our existing HTML table
      $('#requestList table tbody').html(requestTableContent);
  });
  </code></pre>
  
  <p>I was wondering if this is possible? And if so what I'm doing wrong here...</p>
  
  <p><strong><em>EDIT:</em></strong> I'm asking this because it should populate a table with the data from the getJSON requests but it's not.</p>