Skip to main content

Bug Tracker

Side navigation

#4366 closed bug (fixed)

Opened March 17, 2009 09:02PM UTC

Closed April 12, 2011 04:12AM UTC

$.each fails in IE with document.styleSheets

Reported by: d.wachss Owned by:
Priority: high Milestone: 1.6
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description
$.each (document.styleSheets, function(){}); 

fails in Internet Explorer with the error:

Line: 692
Character: 11
Code: 0
Error Message: Invalid procedure call or argument

It seems the problem is the object[++i] at the end of the loop in $.each;

instead of returning undefined it throws the error.

Attachments (0)
Change History (9)

Changed March 21, 2009 02:42AM UTC by dmethvin comment:1

jQuery-dev related thread:

http://groups.google.com/group/jquery-dev/browse_frm/thread/80ff60037e954521#

I tend to agree that this may be something to document rather than fix, since it should be relatively rare.

Changed March 26, 2009 12:08AM UTC by mkruse comment:2

Great post by Richard Cornford analyzing this bug:

http://groups.google.com/group/comp.lang.javascript/msg/468705660cc10d82

Looks like this is a bug that can be fixed.

Changed March 26, 2009 01:24AM UTC by d.wachss comment:3

The bug is fixable, but Richard Cornford's analysis is wrong. The bug shows up no matter how large the collection is. His comments are largely aimed at criticizing jQuery.

Changed August 07, 2009 05:03PM UTC by dmethvin comment:4

component: unfilledcore

Changed November 18, 2010 03:45AM UTC by dmethvin comment:5

milestone: 1.4
status: newopen

Changed March 25, 2011 06:06PM UTC by dmethvin comment:6

milestone: → 1.6
priority: minorhigh

Changed March 25, 2011 06:06PM UTC by dmethvin comment:7

#7946 is a duplicate of this ticket.

Changed March 30, 2011 05:15PM UTC by jboesch comment:8

_comment0: Committing patch in a sec :)1301505610783955

Changed April 12, 2011 04:12AM UTC by john comment:9

resolution: → fixed
status: openclosed

Landed.