Wednesday, January 28, 2009

[jQuery] Re: function after "each" -loop

MZ... what role does the first "LoopComplete();"
play in the code in your response at the bottom of the page.

How would the code behave differently if it was just

$(document).ready(function() {
$("input[@name='category']").each(function() {

});

function LoopComplete() {
alert("All done with loop!");

});

Thanks for any guidance and info...

Rick

> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On Behalf Of MorningZ
> Sent: Wednesday, January 28, 2009 10:32 AM
> To: jQuery (English)
> Subject: [jQuery] Re: function after "each" -loop
>
>
> Just put the call after the each loop
>
> $(document).ready(function() {
> $("input[@name='category']").each(function(){
>
> });
> LoopComplete();
> });
> function LoopComplete() {
> alert("All done with loop!");
> }
>
>
>
>
>
>
> On Jan 28, 10:13 am, johannesF <johannes.foss...@gmail.com> wrote:
> > Hi
> >
> > Need som smart advice here, I have a "each"loop like this.
> >
> > $("input[@name='category']").each(function(){
> >
> > });
> >
> > And then I want to run a function after the "each" i done Is that
> > possible?
> >
> > all the best / johannes

No comments: