[jQuery] Re: Combining results of two getJSON calls

2009-03-08 Thread Dr. Drang
Thank you, Michael. Of course, the display loop has to be nested inside the inner getJSON. $.getJSON(friendsURL, function(friends){ $.getJSON(repliesURL, function(replies){ friends = $.merge(friends, replies); $.each(friends, function(item){ // Display the item. }); // each

[jQuery] Re: Combining results of two getJSON calls

2009-03-07 Thread Michael Geary
Here's an even better set of console.log() calls: $.getJSON(friendURL, function(friends){ console.log( 1, friends.length ); $.getJSON(replyURL, function(replies){ console.log( 2, friends.length ); $.extend(friends, replies); console.log( 3, friends.length ); }); consol

[jQuery] Re: Combining results of two getJSON calls

2009-03-07 Thread Michael Geary
Put some console.log() calls in your code and run it with Firebug enabled: $.getJSON(friendURL, function(friends){ console.log(1); $.getJSON(replyURL, function(replies){ console.log(2); $.extend(friends, replies); console.log(3); }); console.log(4); $.each(friends,