Running the following outputs the expected results for me:

var pass = true;
$('body').empty().append('<div class="myClass"> <span id="thisIsFirst">
<em>1</em> test1 </span> <span id="thisIsNothing"> test2 </span> <span
id="thisIsLast"> test2 </span> </div>');
if($('.myClass').find(':first-child').size() !== 2) pass=false;
if($('.myClass').children(':first').size() !== 1) pass=false;
$('body').css({background:(pass?'green':'red')});

This is true to both 1.3rc1 and to 1.2.6.

In the above we expect:
// selects all elements witch are the first-child to it's parents, <span
id="thisIsFirst"> and <em> should match.
$('.myClass').find(':first-child');
// from all .myClass children, selects only the first. Only <span
id="thisIsFirst"> should match.
$('.myClass').children(':first');

--Iraê


On Tue, Jan 13, 2009 at 11:11 AM, nachocab <[email protected]> wrote:

>
> Hey,
> I've seen different behavior with these two functions in my
> application after switching from 1.2.6 to 1.3rc2. I haven't been able
> to come up with a test case, but I think it's related to append,
> prepend,before and after (which is what I use before doing
> calling .find())
> Anyway, if anybody else has run into this and knows the explanation I
> would really appreciate it. If you have been running into problems and
> your application uses something like:
> $('.myClass').find(':first-child')
> use this instead:
> $('.myClass').children(':first')
>
> Nacho
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to