[jQuery] Re: Newbie - is there a better way to do this?
Then my javascript is like this: function load_progressives() { $(.progressive).each(function(n) { var wrapset = $(.progressive).slice(n) wrapset.load(wrapset.attr('href')) }); } This should work: function load_progressives() { $(.progressive).each(function() { $(this).load(this.href); }); }
[jQuery] Re: Newbie - is there a better way to do this?
Thanks it works great! I had tried using this but missed that it should be $(this). On Oct 31, 11:45 am, Mike Alsup [EMAIL PROTECTED] wrote: Then my javascript is like this: function load_progressives() { $(.progressive).each(function(n) { var wrapset = $(.progressive).slice(n) wrapset.load(wrapset.attr('href')) }); } This should work: function load_progressives() { $(.progressive).each(function() { $(this).load(this.href); }); }
[jQuery] Re: Newbie - is there a better way to do this?
Actually, for some reason, I've had to use $(this).attr('href') instead of this.href. Is there some reason for this? On Oct 31, 1:03 pm, Leo [EMAIL PROTECTED] wrote: Thanks it works great! I had tried using this but missed that it should be $(this). On Oct 31, 11:45 am, Mike Alsup [EMAIL PROTECTED] wrote: Then my javascript is like this: function load_progressives() { $(.progressive).each(function(n) { var wrapset = $(.progressive).slice(n) wrapset.load(wrapset.attr('href')) }); } This should work: function load_progressives() { $(.progressive).each(function() { $(this).load(this.href); }); }
[jQuery] Re: Newbie - is there a better way to do this?
Probably because href isn't a DOM standard property of a div On Oct 31, 1:13 pm, Leo [EMAIL PROTECTED] wrote: Actually, for some reason, I've had to use $(this).attr('href') instead of this.href. Is there some reason for this? On Oct 31, 1:03 pm, Leo [EMAIL PROTECTED] wrote: Thanks it works great! I had tried using this but missed that it should be $(this). On Oct 31, 11:45 am, Mike Alsup [EMAIL PROTECTED] wrote: Then my javascript is like this: function load_progressives() { $(.progressive).each(function(n) { var wrapset = $(.progressive).slice(n) wrapset.load(wrapset.attr('href')) }); } This should work: function load_progressives() { $(.progressive).each(function() { $(this).load(this.href); }); }
[jQuery] Re: Newbie - is there a better way to do this?
Makes sense, thanks. On Oct 31, 1:20 pm, MorningZ [EMAIL PROTECTED] wrote: Probably because href isn't a DOM standard property of a div On Oct 31, 1:13 pm, Leo [EMAIL PROTECTED] wrote: Actually, for some reason, I've had to use $(this).attr('href') instead of this.href. Is there some reason for this? On Oct 31, 1:03 pm, Leo [EMAIL PROTECTED] wrote: Thanks it works great! I had tried using this but missed that it should be $(this). On Oct 31, 11:45 am, Mike Alsup [EMAIL PROTECTED] wrote: Then my javascript is like this: function load_progressives() { $(.progressive).each(function(n) { var wrapset = $(.progressive).slice(n) wrapset.load(wrapset.attr('href')) }); } This should work: function load_progressives() { $(.progressive).each(function() { $(this).load(this.href); }); }