预期的标识符,字符串或数字 [英] Expected identifier, string or number
本文介绍了预期的标识符,字符串或数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个像这样的对象;
I have an object like;
var defaults = {
id: 'ActionSlider',
element: '',
closeBtnWidth: 55,
panelWidth: 320,
class: '',
css: {},
create: function() {},
},
当我在IE8标准中运行我的页面时,它给了我跟随错误;
and when i run my page in IE8 standards its giving me the following error;
SCRIPT1028:预期的标识符,字符串或数字
和积分到行:class:'',
and points to the line : class:' ',
任何人都可以告诉我为什么我不能用这个用于IE?
是保留字还是什么?
can anyone please tell me why i cant use this for IE? is it a reserved word or something?
推荐答案
你需要在周围添加引号class
这是一个保留字。另请注意,您应该删除最后一个逗号:
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() {}
}
这篇关于预期的标识符,字符串或数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文