Thanks for the reply, Michael...I caught the missing ), too.

I was wondering, also, what the purpose of the ".trigger('change');" has.

I read that it is used for passing data into the triggered function?

Is my understanding correct?  Can you give me a scenario where
that is likely to be used?

Rick

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On 
> Behalf Of Michael Geary
> Sent: Saturday, January 24, 2009 4:28 PM
> To: [email protected]
> Subject: [jQuery] Re: Would someone pleae tell me what's wrong with this 
> syntax?
> 
> 
> Let's try collapsing out the irrelevant code and take out the newlines too:
> 
>     $('#select').change(function() {});.trigger('change');
> 
> Does that make it easier to spot the error?
> 
> -Mike
> 
> > From: Rick Faircloth
> >
> > Hi, all...
> >
> > I keep getting this error from Firebug:
> >
> > syntax error
> > .trigger('change'); \n
> >
> > for this code:
> >
> >             $(document.ready(function() {
> >
> >                     $('#select').change(function() {
> >
> >                             var newName = '';
> >                             $('select
> > option:selected').each(function() {
> >                                     newname += $(this).text() + ' ';
> >                             });
> >
> >                     $('#name-div p').text(newName+' [Change]');
> >                     $('#name-div').fadeIn(500);
> >
> >                     });
> >
> >                     .trigger('change');
> >             });
> >
> > What's wrong with it?
> >
> > Thanks,
> >
> > Rick
> >


Reply via email to