[jQuery] Re: declare variable

2009-05-14 Thread Richard D. Worth
Yup. See https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Statements/Var - Richard On Thu, May 14, 2009 at 2:12 AM, runrunforest craigco...@gmail.com wrote: Hi, I see this line in a plugin var $thisCell, $tgt = $(event.target); does that mean: var $thisCell =

[jQuery] Re: declare variable

2009-05-14 Thread Michael Geary
Nope. This: var $thisCell, $tgt = $(event.target); does not mean: var $thisCell = $(event.target); var $tgt = $(event.target); After all, there's only one jQuery object being created in the first example, and two distinct objects in the second. Nor does it set both variables to

[jQuery] Re: declare variable

2009-05-14 Thread Peter Warnock
No. $thisCell is initialized with a null value in the current scope. - pw On May 13, 11:12 pm, runrunforest craigco...@gmail.com wrote: Hi, I see this line in a plugin var $thisCell, $tgt = $(event.target); does that mean: var $thisCell = $(event.target); var $tgt = $(event.target);

[jQuery] Re: declare variable

2009-05-14 Thread Richard D. Worth
Thanks for the correction Michael. Looks like I didn't look closely enough. Sorry for the noise. - Richard On Thu, May 14, 2009 at 11:12 AM, Michael Geary m...@mg.to wrote: Nope. This: var $thisCell, $tgt = $(event.target); does not mean: var $thisCell = $(event.target); var

[jQuery] Re: declare variable

2009-05-14 Thread Michael Geary
Actually, $thisCell is initialized with the *undefined* value, not the *null* value. var foo; // undefined var bar = null; // null alert( foo === bar ); // false alert( foo == bar ); // true, but only because of type conversion -Mike From: Peter Warnock No. $thisCell