> The modification to is() won't break any existing code that uses is() as > documented (with only one paramter).
What I mean by changing the behavior of the is method is this ... The is method returns true or false based on the condition. What will the return value be if you pass in a function or two functions for if/else? Would it still return true/false or the actual unchanged jQuery object? Same question applies for the not method suggestion ... Would it return a modified jQuery object or an unmodified one when functions are passed? > This avoids the anonymous functions, but it's use is limited to jQuery > methods. So I think maybe I missed the goal of the $else construct. It seems its purpose is to provide a way to apply only jQuery methods. I can see the benefit of this but still really dislike the name since it is a keyword. Maybe name it 'otherwise'. I still think providing a method named 'ifelse' that takes an expression and two methods or maybe even one. I could see this being very useful and flexible. The 'ifelse' method would return the jQuery object unmodified. -- Brandon Aaron On 10/2/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > Brandon Aaron schrieb: > > ** Going to re-read to make sure I'm not complete off-base ** > > > > Okay ... so after re-reading I think that Jörn's first idea is the > > better one than the other suggestions. My only concern is that it > > changes the behavior of the is method. I still think making this its > > own method is the best option. > > > > With that said I think either modifying the is method, not method or > > *preferably* adding a new method with this simple syntax will be very > > useful! > > > The modification to is() won't break any existing code that uses is() as > documented (with only one paramter). > But before closing this topic: Could you please have a look at the other > solution to this: http://jquery.com/discuss/2006-October/012969/ > This avoids the anonymous functions, but it's use is limited to jQuery > methods. > > -- Jörn > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
