Closed ralt closed 12 years ago
<html>
<head>
<!-- [if IE 8]>
<script src="https://raw.github.com/Raynos/DOM-shim/master/lib/DOM-shim-ie8.js"></script>
<![endif] -->
<script src="https://raw.github.com/Raynos/DOM-shim/master/lib/DOM-shim.js"></script>
<script src="https://raw.github.com/kriskowal/es5-shim/master/es5-shim.js"></script>
</head>
<body>
<p id=test>test</p>
<script>
var domains = ["test"];
domains.forEach(function(e){
alert(document.querySelector("#" + e).innerHTML)
});
</script>
Works even in IE7. WAIDW?
Well, I guess this is on my environment then.
Debugging in IE, I've found that [].forEach()
returns the same error message right before the domains.forEach
line.
If I put the ES5-shim script after the DOM-shim, using [].forEach()
works correctly after the page has completely loaded.
If I put the ES5-shim script before the DOM-shim, I get the following error on line 23:
Exception thrown and not caught
However, using [].forEach()
works once the page is loaded.
I don't get what is wrong, and I don't know how I should debug this.
I don't get it either :D
Here is a jsfiddle: http://jsfiddle.net/YhG7H/
This jsfiddle, with IE8, shows the behavior explained up there (error at line 23, etc).
I have IE8.0.6001.18702.
change the order of es5 shim and dom shim and problem solved
No, it doesn't solve the problem. But I don't have time to mess around with this for now, I'll reopen when I'll have more information.
Just including the following in my HTML like this:
Gives the following error in IE8:
IE tells me the error is on line 23:
Is
forEach
supported in IE8? Adding ES5-shim doesn't help since it doesn't support IE8 (well, it throws an exception, so the shim doesn't work).