Reputation: 45
I have an object like;
var defaults = {
id: 'ActionSlider',
element: '',
closeBtnWidth: 55,
panelWidth: 320,
class: '',
css: {},
create: function() {},
},
and when i run my page in IE8 standards its giving me the following error;
SCRIPT1028: Expected identifier, string or number
and points to the line : class:' ',
can anyone please tell me why i cant use this for IE? is it a reserved word or something?
Upvotes: 3
Views: 2580
Reputation: 634
Usually class refers to the class attribute of any object like <div >
, <input >
etc. which shows displays class as <div class="someclass">
Upvotes: 0
Reputation: 31467
You need to add quotes round the class
which is a reserved word. Please also note, that you should remove the last comma:
var defaults = {
id: 'ActionSlider',
element: '',
closeBtnWidth: 55,
panelWidth: 320,
"class": '',
css: {},
create: function() {}
}
Upvotes: 6