Hi Nic,

No worries. You're right about :first-child.

Ricardo, I have no idea why it wasn't caught in the test suite. Seems like another handful of tests are warranted. I posted a message on the dev list, pointing to this thread and the bug ticket, so hopefully John can get it taken care of for 1.3.1.

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jan 17, 2009, at 4:19 PM, Nic Luciano wrote:

Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first- child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)?

Can't believe I overlooked that-  I stand corrected :D

On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi <ricardob...@gmail.com> wrote:

I know this isn't the dev list, but I'm curious about how come these
bugs weren't caught by the test suite?

On Jan 17, 6:50 pm, Karl Swedberg <k...@englishrules.com> wrote:
> Nic,
> Actually, it is a bug, at least in the sense that the results are
> different from those of any previous version of jQuery.
>
>   It isn't just about :first, though. It has to do with multiple-
> descendant selectors in general. I've provided a test case 
athttp://test.learningjquery.com/selector-bug.html
> with side-by-side comparison of 1.2.6 and 1.3, showing the number of
> matches (and I also posted an update to the ticket).
>
> --Karl
>
> ____________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote:
>
> > That's true, but that's exactly how it's supposed to function.
>
> > On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover
> > <ilovejqu...@gmail.com> wrote:
>
> > No he is not!
>
> > Suppose you have this scenario:
>
> > <div id="container">
> >       <ul id="menu">
> >               <li>Home</li>
> >               <li><a href="#">Rules</a></li>
> >               <li><a href="#">Pilots</a></li>
> >               <li><a href="#">Briefing</a></li>
> >               <li><a href="#">IGC</a></li>
> >               <li><a href="#">Results</a></li>
> >               <li><a href="#">Forum</a></li>
> >       </ul>
> > </div>
>
> > $('#menu li:first a').remove() - will do nothing here, since first li
> > has no anchor in it !
>
> > ----
> > Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com
>
> > On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 <ch...@post.cz> wrote:
>
> > > Well, you are right, thx for explanation. Now it is clear!!
>
> > > On 17 Led, 21:04, Pedram <pedram...@gmail.com> wrote:
> > >> hi Guys , I know what should you do ,
> > >> $('#menu li:first a').remove()
> > >> this is the code you need , jquery has no problem when you use this > > >> code $('#menu li a:first').remove(); the selector checks each li
> > and
> > >> removes the <a> so all of the links will be removed so in your case
> > >> your code should look like this $('#menu li:first a').remove();
> > the
> > >> selector selects the first li and removes the <a>
> > >> that set,
> > >> I am just following john Resig in twitter it seems he is going to
> > >> release jquery 1.3.1 maybe he found some little bugs.


Reply via email to