Bug Tracker

Modify

Ticket #6427 (closed bug: wontfix)

Opened 3 years ago

Last modified 23 months ago

:not(:last) with only one element returns different results

Reported by: sant0sk1 Owned by:
Priority: low Milestone: 1.next
Component: selector Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

Given an html snippet like this:

<div id="main">

<div class="item"><p>some words</p></div>

</div>

Running the following code:

$('#main').find('.item:not(:last)').length

Returns 1 in IE8, and 0 in Safari and Firefox:

Change History

comment:1 Changed 3 years ago by dmethvin

Yep, does look like a bug. IE seems to be selecting div.item for some reason.

comment:2 Changed 3 years ago by miketaylr

  • Priority set to low
  • Status changed from new to open
  • Milestone changed from 1.4.3 to 1.4.5

Live test case here:  http://jsfiddle.net/pKHuY/ and confirmed that Opera and Chrome align with Safari and Firefox, reporting 0. IE8 and IE9 preview report 1.

comment:3 Changed 23 months ago by john

  • Status changed from open to closed
  • Resolution set to wontfix

You should be using .slice(1) instead of this:  http://docs.jquery.com/Won%27t_Fix

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.