[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
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,

[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 ); });

[jQuery] Re: combining results

2008-08-25 Thread Karl Swedberg
Hi Jonathan, Try this: var x = $('span'); var y = $('div'); var z = x.add(y); z.each(function(){alert('yo');}) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Aug 25, 2008, at 11:19 AM, Jonathan C. Dietrich wrote: What is the easiest way to combine the

[jQuery] Re: combining results

2008-08-25 Thread Karl Swedberg
Or, if you want to do it in one fell swoop: var z = $('div, span'); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Aug 25, 2008, at 12:14 PM, Karl Swedberg wrote: Hi Jonathan, Try this: var x = $('span'); var y = $('div'); var z = x.add(y);

[jQuery] Re: combining results

2008-08-25 Thread Jonathan C. Dietrich
Thanks Karl. On Aug 25, 12:21 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Or, if you want to do it in one fell swoop: var z = $('div, span'); --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Aug 25, 2008, at 12:14 PM, Karl Swedberg wrote: Hi Jonathan,