Bug Tracker

Modify

Ticket #6411 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

Class Selector sometimes fails in IE6

Reported by: Pyro979 Owned by:
Priority: Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: class, selector, ie6 Cc:
Blocking: Blocked by:

Description

First of I'd like to state that I know this will be difficult to find as the bug is reproducible only on certain machines running IE6. I only found it because I wrote a javascript error reporting tool into our web app, and tracked this bug down to specific lines of code. Out of thousands of users only dozens have experienced the bug, always with IE6, and possibly only after the update to jQuery 1.4

The bug is as follows, a jQuery select such as $(".bodyDiv") will return a null object. Changing the class selector to an id selector such as $("#bodyDivId") eliminates the problem.

Solutions I've tried that have failed are: delaying execution by 400ms

Solutions I will try is using this fugly selector: $("[class*=className]") and trying to roll back to jQuery 1.3 (which is clearly suboptimal)

Once again, I know this will be hard to fix because it's difficult to reproduce (I could not on out IE6 installation) but if someone can try to figure out how this can happen (tracking how the null object is being returned is probably the most likely way to find the problem), and if not fixing it, maybe at least fallback to selecting it using the fugly selector above, I would be eternally grateful.

If there are any question or possible solutions I can try out I'm more than willing to help.

Change History

comment:1 Changed 4 years ago by Pyro979

Follow up. The problem appear to happen when I write a very large collection of DOM objects to the document and then try to do class selectors on items in this collection. I was able to get around the problem by delaying the execution of the functions that use the class selectors by about 400ms.

My theorised solution of using $("[class*=className]") failed miserably.

comment:2 Changed 4 years ago by dmethvin

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

There do seem to be cases where IE6 won't update the document view immediately and it takes a setTimeout to let it catch up. Unfortunately there isn't likely to be much jQuery can do to fix this.

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.