[jQuery] Re: Question about variable declaration

2008-08-20 Thread andrea varnier
thank you very much, all of you! :) Now I got it, I really appreciate your help. andrea

[jQuery] Re: Question about variable declaration

2008-08-19 Thread Nicola Rizzo
$('.left_selected') returns always true, because if there's not a matching element, $('.left_selected') is an array (not null) with length = 0. hth, Nicola On Tue, Aug 19, 2008 at 10:34 AM, andrea varnier [EMAIL PROTECTED] wrote: Hi :) in your plugins (I'm studying from the best here :)))

[jQuery] Re: Question about variable declaration

2008-08-19 Thread Ryura
The problem here is that neither of your expressions can EVER evaluate to false. Even if no actual DOM element is selected, you still get an empty (jQuery)array. On Aug 19, 4:34 am, andrea varnier [EMAIL PROTECTED] wrote: Hi :) in your plugins (I'm studying from the best here :))) I often find

[jQuery] Re: Question about variable declaration

2008-08-19 Thread besh
Hi Andrea, it's really a matter of true or false. The attr() method returns a string and so if it returns an empty one, it's evaluated as false and the part after the || operator is then taken. You use jQuery wrapper on both sides of the || operator and jQuery wrapper always returns something

[jQuery] Re: Question about variable declaration

2008-08-19 Thread RobG
On Aug 19, 6:34 pm, andrea varnier [EMAIL PROTECTED] wrote: Hi :) in your plugins (I'm studying from the best here :))) I often find variable assignments like this:     options = $.extend({         url:  this.attr('action') || window.location.toString(),         type: this.attr('method')