Skip to main content

Bug Tracker

Side navigation

#6411 closed bug (wontfix)

Opened April 08, 2010 02:53PM UTC

Closed June 12, 2010 02:41AM UTC

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:
Blocked by: Blocking:

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:


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.

Attachments (0)
Change History (2)

Changed May 04, 2010 06:44PM UTC by Pyro979 comment:1

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.

Changed June 12, 2010 02:41AM UTC by dmethvin comment:2

resolution: → wontfix
status: newclosed

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.