I have the following code:
var APP= APP || {};
APP.settings = {
apiRoot: "http://localhost/appapi",
siteRoot: "http://localhost",
};
This code works in Chrome and Firefox but is throwing an error in IE8, Unable to set value of the property 'settings': object is null or undefined
This isn’t my code so I’m at a bit of a loss to why this isn’t working?
The problem is the trailing comma in your object property list, which IE < 9 does not like and throws an error. Remove it and it will be fine.