Thanks for all your advices.

> $$('#pleaseWait').invoke('hide');

I do like this one, even if I am not sure why it would be a bad
practice to have failsafe functions (I said "functions", not
"methods" :o) ).

It is common in C++ to check if a pointer is null before freeing it. I
don't see any difference with this case, but I'll be happy with the $$
('#...) solution.

Just to be clear, it is not that invoke is null-safe, but it will just
invoke "hide" method with all elements of the enumerable, which will
happen to be empty if the DOM element doesn't exist (so, hide will not
be called at all).

I did thought to the same kind of solution using $
('pleaseWait','xx').invoke(hide) ('xx' being a non-existing id) but I
do prefer Justin's.

Eric


>
> -justin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to