Side navigation
#7946 closed bug (duplicate)
Opened January 11, 2011 03:44PM UTC
Closed March 25, 2011 06:06PM UTC
Last modified March 10, 2012 08:37AM UTC
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>
Attachments (0)
Change History (5)
Changed January 13, 2011 10:13AM UTC by comment:1
Changed January 17, 2011 07:28PM UTC by comment:2
component: | unfiled → core |
---|---|
keywords: | → needsreview |
priority: | undecided → high |
status: | new → open |
Confirmed.
Marked as high, but needs closer review
Changed March 25, 2011 05:45PM UTC by comment:3
keywords: | needsreview |
---|---|
milestone: | 1.next → 1.6 |
owner: | → dmethvin |
status: | open → assigned |
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.
Changed March 25, 2011 06:06PM UTC by comment:4
resolution: | → duplicate |
---|---|
status: | assigned → closed |
jsFiddle sample URL: http://jsfiddle.net/GgrSV/