I knew IE8 was a pain, but I have never seen it give me such trouble. All I am trying to do is define a Javascript object and it causes an error, stopping all scripting from working on the page.
The error is "Expected identifier, string or number" and indicates that the issue happens where I define the property "class" below. I have seen countless scripts define objects this way, so why does IE8 vomit on this?
I isolated the offending code to this. Placing this in the head of an HTML page by itself and running it in IE8 will cause the issue I am seeing.
<script type="text/javascript" language="javascript">
var atts = {class: "trigger"};
</script>
Define using appropriate data type by enclosing in quotes, "class"
It is because class
is a reserved keyword. Try putting quotes around it 'class'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With