On Feb 20, 2011, at 12:18 PM, kstubs wrote:
T.J., one question for:
div = $("#errordlg");
if (div) { // Paranoia
div.remove();
I don't recognize this syntax: $("#errordlg");
This is different than (what I would typically write): $('errordlg');
Either TJ has been moonlighting in jQuery, or it's a typo. Here's
another way to write it that eliminates the if and also uses the hash:
$$('#errordig').invoke('remove');
This one-liner rolls up the conditional, since it takes an array
(which may be zero-length) and invokes the remove method on all of its
members. If there are no members, it's a noop.
Walter
What am I missing?
--
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 prototype-scriptaculous+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
.
--
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
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.