declaring jQuery objects with the $foo pattern

Jacob Farber jacob.farber at utoronto.ca
Fri Aug 22 13:36:10 UTC 2008


Do you have a link to the discussion? Im just curious to take a peek.
I would think if there is a jQuery specific approach (like using $foo) 
it would a little more "upgrade-safe" than something so explicit....
Jacob

Eli Cochran wrote:
> That makes sense since we're so jQuery dependent. I was just surprised 
> to learn that many jQuery developers do it the other way. 
>
> - Eli
>
> On Aug 22, 2008, at 6:07 AM, Michelle D'Souza wrote:
>
>> I've been using the assumption that everything is a jQuery unless 
>> specified. So:
>>
>> var foo = $("div");
>>
>> var fooEl = foo[0];
>>
>> Michelle
>>
>> On 21-Aug-08, at 2:40 PM, Eli Cochran wrote:
>>
>>> Hi,
>>> There is a little discussion on the jQuery Google Group about using 
>>> $ when declaring variables that contain a jQuery object.
>>>
>>> So:
>>>
>>> var $foo = $("div");
>>>
>>> instead of just:
>>>
>>> var foo = $("div");
>>>
>>> Any opinions.
>>>
>>> I have a case, in the scroller, were I have to refer to an element 
>>> both as a jQuery object and a DOM object (because jQuery doesn't 
>>> support the method that I need) and it would make the code perhaps 
>>> clearer... at least to those who know the convention. Perhaps more 
>>> confusing to those who don't.
>>>
>>> - Eli
>>>
>>> . . . . . . . . . . .  .  .   .    .      .         .             
>>>  .                     .
>>>
>>> Eli Cochran
>>> user interaction developer
>>> ETS, UC Berkeley
>>>
>>>
>>> _______________________________________________
>>> fluid-work mailing list
>>> fluid-work at fluidproject.org <mailto:fluid-work at fluidproject.org>
>>> http://fluidproject.org/mailman/listinfo/fluid-work
>>
>> ------------------------------------------------------
>> Michelle D'Souza
>> Software Developer, Fluid Project
>> Adaptive Technology Resource Centre
>> University of Toronto
>>
>>
>>
>
> . . . . . . . . . . .  .  .   .    .      .         .              .  
>                    .
>
> Eli Cochran
> user interaction developer
> ETS, UC Berkeley
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fluid-work mailing list
> fluid-work at fluidproject.org
> http://fluidproject.org/mailman/listinfo/fluid-work
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://fluidproject.org/pipermail/fluid-work/attachments/20080822/facf3cc7/attachment.html>


More information about the fluid-work mailing list