Bug Tracker

Ticket #4366 (closed bug: fixed)

Opened 5 years ago

Last modified 3 years ago

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

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

comment:1 Changed 5 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 5 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 5 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 5 years ago by dmethvin

  • Component changed from unfilled to core

comment:5 Changed 4 years ago by dmethvin

  • Status changed from new to open
  • Milestone 1.4 deleted

comment:6 Changed 3 years ago by dmethvin

  • Priority changed from minor to high
  • Milestone set to 1.6

comment:7 Changed 3 years ago by dmethvin

#7946 is a duplicate of this ticket.

comment:8 Changed 3 years ago by jboesch

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

comment:9 Changed 3 years ago by john

  • Status changed from open to closed
  • Resolution set to fixed

Landed.

Note: See TracTickets for help on using tickets.