Skip to content Skip to sidebar Skip to footer

Javascript In Ie11 Giving Me Script Error 1003

I have a site with an accordion and some javascript. In Firefox everything is working as it should, but in IE11 I get the error SCRIPT1003: Expected ':' I narrowed it down to thi

Solution 1:

The syntax ({nmArray}) in a browser that supports ES6 is a shortcut for {nmArray: nmArray}. IE11 doesn't support this feature (based on the error you're receiving), so you'll have to rewrite it as:

data: ({ nmArray: nmArray }),

See here for an example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_6

note that in this case you can omit the wrapping ()

data: { nmArray: nmArray },

Post a Comment for "Javascript In Ie11 Giving Me Script Error 1003"