Bug Tracker

Opened 15 years ago

Closed 12 years ago

#4366 closed bug (fixed)

$.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.

Change History (9)

comment:1 Changed 15 years ago by dmethvin

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.

comment:2 Changed 15 years ago by mkruse

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.

comment:3 Changed 15 years ago by d.wachss

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.

comment:4 Changed 14 years ago by dmethvin

Component: unfilledcore

comment:5 Changed 13 years ago by dmethvin

Milestone: 1.4
Status: newopen

comment:6 Changed 13 years ago by dmethvin

Milestone: 1.6
Priority: minorhigh

comment:7 Changed 13 years ago by dmethvin

#7946 is a duplicate of this ticket.

comment:8 Changed 12 years ago by jboesch

Last edited 12 years ago by jboesch (previous) (diff)

comment:9 Changed 12 years ago by john

Resolution: fixed
Status: openclosed

Landed.

Note: See TracTickets for help on using tickets.