jQuery: The Write Less, Do More JavaScript Library

 « Return to Thread: Question on : syntax

Re: Question on : syntax

by Michael Lawson :: Rate this Message:

Reply to Author | View in Thread

One thing to keep in mind, is that when you are using : to specify a filter, it will always be inside of a string. "input:button" for example.
The syntax you have here is the key value notation in javascript. It will almost always exist outside of a string. You are setting the setup key to the anonymous function you have there.

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone: 1-276-206-8393
E-mail: mjlawson@...

'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.'

Inactive hide details for expresso ---07/02/2009 01:09:31 PM---I have yet another syntax question.expresso ---07/02/2009 01:09:31 PM---I have yet another syntax question.


From:

expresso <dschinkel@...>

To:

"jQuery (English)" <jquery-en@...>

Date:

07/02/2009 01:09 PM

Subject:

[jQuery] Question on : syntax






I have yet another syntax question.

I know that : can be used for specifying things like filters, but what
does it do in this case:

   $jc.fn.extend({

       setup: function() {
           this.first     = null;
           this.last      = null;
           this.prevFirst = null;
           this.prevLast  = null;
           this.animating = false;
           this.timer     = null;
           this.tail      = null;
           this.inTail    = false;

           if (this.locked)
               return;

           this.list.css(this.lt, this.pos(this.options.offset) +
'px');
           ...rest of code here
       },

so what is the syntax setup:    an attribute?




 « Return to Thread: Question on : syntax