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?
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?
Share Improve this question edited Feb 5, 2013 at 7:48 KARASZI István 31.5k9 gold badges106 silver badges131 bronze badges asked Feb 5, 2013 at 7:46 user2042215user2042215 452 silver badges4 bronze badges4 Answers
Reset to default 6You need to add quotes round the class
which is a reserved word. Please also note, that you should remove the last ma:
var defaults = {
id: 'ActionSlider',
element: '',
closeBtnWidth: 55,
panelWidth: 320,
"class": '',
css: {},
create: function() {}
}
Yep, class
is a reserved word. MDN
class
is reserved words in javascript
Usually class refers to the class attribute of any object like <div >
, <input >
etc. which shows displays class as <div class="someclass">
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744791311a4593931.html
评论列表(0条)