Bug Tracker

Modify

Ticket #5480 (closed bug: invalid)

Opened 4 years ago

Last modified 2 years ago

IE7 selector problem

Reported by: ScorpioN Owned by: ScorpioN
Priority: major Milestone:
Component: selector Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

Hi! It seems I've found a bug.

I've created several inputs dynamically and set attribute "all=1" to some of them. In FF and IE8 all works fine. But in IE7:

$('input[all]').size() == 8 AND $('input[all=1]').size() == 2 (this correct)

I'm using jquery 1.3.2.

Change History

comment:1 Changed 4 years ago by dmethvin

I suspect the problem is that IE is adding an .all property to every element, which is a collection representing the descendant elements. It was most often used as document.all but it's available on every element. So, where there is no explicit all attribute, jQuery is seeing the all property.

In general, it's a bad idea to add nondistinctive names and properties to html elements. You might want to try "x_all" as your attribute name to avoid collisions.

This is similar to, if not the same as, #3113 which has the problem with form property name/attribute confusion.

comment:2 Changed 3 years ago by dmethvin

  • Component changed from unfiled to selector

comment:3 Changed 3 years ago by dmethvin

  • Owner set to ScorpioN
  • Status changed from new to pending

Can you provide a test case in jsfiddle? I'd like to know which 2 of 8 elements it found.

comment:4 Changed 2 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Automatically closed due to 14 days of inactivity.

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.