addEvent('click',function(){return f() && false;})
amounts to the same thing.

I still don't see the need here. "return false" is just not that big of a
burden.

On Wed, Apr 22, 2009 at 2:37 PM, Sanford Whiteman [Mobile] (via Nabble) <
[email protected]<ml-user%[email protected]>
> wrote:

>
> > If  all you want to do is make an element not be clickable, then the
> > example holds up (as it's comment notes).
>
> Dunno, if you aren't binding a real method at all, to me adding a fake
> method just to return false is more esoteric/semantically unclear than
> removing  the  `href`  attribute  or  completely  removing the <a> and
> substituting  plain  text. (Me, I usually remove the href and also add
> the  not-allowed  cursor  if  people are used to seeing a live link at
> other times.)
>
> > But  if  instead  you  want  to  attach  a method from a class to an
> > element  and  stop  the  event,  it's  esoteric  to  use it for that
> > purpose...
>
> I  did  agree from the top that stop() is the proper way, I'm just not
> convinced  that  -- once you decide to return false instead -- there's
> anything  super-wrong  with  trying *not* to use a wrapper if it turns
> out  to  be  very  concise  (what do you think of Lewis' `returnFalse`
> wrapper?).
>
> Maybe the shortest way to "finalize false" with the smallest amount of
> chaff and no extra methods and no extra event to manage:
>
>      onclick="return f() && false;"
>
>      addEvent('click',function(){return f() && false;})
>
> Not  saying  I'm  all  about  using  these,  but  I  don't see them as
> esoteric.  It's  kind  of  a Catch-22 in that if you are used to using
> return  false,  then  you  understand  it as soon as you see it in the
> event  context...  if  you  use  e.stop()  properly all the time, then
> return false may pop out as an exception.
>
> --Sandy
>
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/-Moo--Return-false-function-tp2669929p2679456.html
> To start a new topic under MooTools Users, email
> [email protected]<ml-node%[email protected]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>


-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
Clientcide:  http://www.clientcide.com www.clientcide.com 
-- 
View this message in context: 
http://n2.nabble.com/-Moo--Return-false-function-tp2669929p2679561.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to