Bug Tracker

Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#7946 closed bug (duplicate)

JS error in IE8, when jQuery.each is used on document.styleSheets

Reported by: anonymous Owned by: dmethvin
Priority: high Milestone: 1.6
Component: core Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

When trying the HTML sample below, IE8 throws an "Error: Invalid procedure call or argument". This happens because a nonexistent entry is accessed on the styleSheets collection.

<html> <head> <style> </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script> $.each(document.styleSheets, function(i) {

alert(i);

}); </script> </head> </html>

Change History (5)

comment:1 Changed 9 years ago by anonymous

jsFiddle sample URL: http://jsfiddle.net/GgrSV/

comment:2 Changed 9 years ago by Rick Waldron

Component: unfiledcore
Keywords: needsreview added
Priority: undecidedhigh
Status: newopen

Confirmed.

Marked as high, but needs closer review

comment:3 Changed 8 years ago by dmethvin

Keywords: needsreview removed
Milestone: 1.next1.6
Owner: set to dmethvin
Status: openassigned

Looks like the attempt to reference object[ ++i ] when i is out of bounds is causing an exception in IE. The fix looks pretty simple though.

comment:4 Changed 8 years ago by dmethvin

Resolution: duplicate
Status: assignedclosed

comment:5 Changed 8 years ago by dmethvin

Duplicate of #4366.

Note: See TracTickets for help on using tickets.