Javascript与IE8 - 预期的标识符,字符串或数字 [英] Javascript vs. IE8 - Expected identifier, string or number
本文介绍了Javascript与IE8 - 预期的标识符,字符串或数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不,这不是一个额外的逗号。
No, it's not an extra comma.
这是给我这个问题的剪辑。
Here is the snip that is giving me the problem.
$(document).ready(function(){
$("div#slider").easySlider({
auto: false,
continuous: true,
nextId: "nextBtn",
prevId: "prevBtn"
});
$("div#slider-banner").easySlider({
auto: true,
continuous: true,
controlsShow: false
});
// <---------------------------------- Line 14
$("div#slider-photos").easySlider({
auto: true,
continuous: true,
controlsShow: false
});
$("#marquee").marquee({
scrollSpeed: 25,
pauseSpeed: 2000,
showSpeed: 850
});
});
错误详细信息
ERROR DETAILS
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET CLR 1.1.4322; Tablet PC 2.0; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
Timestamp: Wed, 6 Apr 2011 15:20:42 UTC
Message: Expected identifier, string or number
Line: 14
Char: 5
Code: 0
这是发生在随机的IE8安装,任何想法?
This is happening on random IE8 installs, any ideas?
推荐答案
尝试将所有对象属性放在(双)引号中,如下所示:
Try putting all your object properties in (double)quotes, like this:
$("div#slider").easySlider({
'auto': false,
'continuous': true,
'nextId': "nextBtn",
'prevId': "prevBtn"
});
这篇关于Javascript与IE8 - 预期的标识符,字符串或数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文