asherringham (1) [Avatar] Offline
#1
Great book.

In chapter 7 (Expand your reach by extending jQuery) on page 213 is listing 7.2 for :

"Implementation of the $.formatDate() custom utility function"

This contains the line :

var matched = $.formatDate.patternParts.exec(pattern);

After some digging, I found that "exec" is a RegExp object function (regexp is "patternParts" defined further down). I think you should have mentioned this in the text somewhere.
maninaction (10) [Avatar] Offline
#2
Re: Ch 7, Pg 213, Listing 7.2 - .exec?
How to select a form that does not have, say, an input, for example?
I tried: form:has(:not(:input)) and I got 1 matching element:
FORM which is not true.
many thanks
bear.bibeault (675) [Avatar] Offline
#3
Re: Ch 7, Pg 213, Listing 7.2 - .exec?
Hmm, let me think on that one.

The selector you posted will not work because the filters are being assigned to the form, not the children.
bear.bibeault (675) [Avatar] Offline
#4
Re: Ch 7, Pg 213, Listing 7.2 - .exec?
re: exec() -- Good point -- it may not be something most JS coders have used,
mraj (104) [Avatar] Offline
#5
Re: Ch 7, Pg 213, Listing 7.2 - .exec?
I'll guess that :input is selecting more than you think it should...

From http://api.jquery.com/input-selector/
"Selects all input, textarea, select and button elements. The :input selector basically selects all form controls."