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
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,
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 );
});
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
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);
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,
6 matches
Mail list logo