On Wed, Nov 5, 2008 at 1:10 PM, brian <[EMAIL PROTECTED]>wrote: > > > > Now $('#non-existing-id').fail().toggle() will fail, > > but will work if it's not empty. > > That's actually right on the money. Thanks. > > //Still thinks fail silently on id queries is insane, but knows a > religious argument when he sees one.
Hmmm ... you don't expect your CSS queries to throw an error if they don't match an element do you? It'd be silly if it did. Then you'd need a separate style sheet for each page instead of making good use of reusing styles. Same goes for jQuery code. Matching zero or more elements is a corner stone of being able to progressively enhance your web site/app with unobtrusive javascript. -- Brandon Aaron