It appears to be a problem with how the selector expression passed to
not() is parsed (so the problem is not with the wildcard selector).
I've found that this works:
jQuery('#ap *').not('code, #mark')
but this doesn't:
jQuery('#ap *').not('#mark, code')
Note the order (ID, TAG) doesn't work, but (TAG, ID) does. I'm running
these tests on the core.js unit test for Sizzle (http://github.com/
jeresig/sizzle/) so I don't have a test page - you can plug in these 2
lines into the core.js unit test to run them for yourself:
isSet( jQuery('#ap *').not('code, #mark'), q("google", "groups",
"anchor1"), "not('tag, ID selector')"); // passes
isSet( jQuery('#ap *').not('#mark, code'), q("google", "groups",
"anchor1"), "not('ID, tag selector')"); // fails
I've only managed to dig so far as notice that (TAG, ID) gets
correctly recognized as a TAG and then an ID preFilter, whereas (ID,
TAG) gets recognized as a PSEUDO preFilter.
I believe a similar bug with the expression parsing is causing the
problem you are reporting too Karl but I haven't dug specifically into
your test cases yet.
Hope this helps anyone looking into the bug. I'm still trying to work
out where the expression parsing is going wrong and will report back
if I manage to fix the bug.
Cheers,
Chu Yeow
On Dec 24, 10:06 am, Karl Swedberg <[email protected]> wrote:
> On Dec 23, 2008, at 5:21 AM, pixeline wrote:
>
> > $('*', allItems).not('p, a,form').show();
>
> > triggers this error in firebug:
> > Error:
> > match[3] is undefined
> > jquery-1.3b1.js
> > Line 1812
>
> > testcase here:http://pixeline.be/experiments/jquerybeta/test1.html
>
> > it seems related to the use of the wildcard '*' but you're the
> > experts :)
>
> I'm getting the same error without using the wildcard:
>
> $('li:not(:last-child)').toggleClass('highlight');
>
> For some reason, the error is appearing in the Firefox Error Console
> but not in Firebug (at least for me).
>
> The following are not returning correct results, but they aren't
> throwing errors either:
>
> $('li').not(':odd').toggleClass('highlight');
>
> $('li').not(':odd:first').toggleClass('highlight');
>
> Test case:http://13beta.learningjquery.com/13b1.html
>
> And using jQuery 1.2.6 (working
> properly):http://13beta.learningjquery.com/126.html
>
> --Karl
>
> ____________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---