前端集合 - 关注前端技术和互联网免费资源

关注前端技术和互联网免费资源

分类儿

页面儿

搜索儿

前端集合 RSS订阅
Home » 前端集合 » JS中的error:Expected identifier, string or number错误

JS中的error:Expected identifier, string or number错误

发布者:前端集合 // 发布时间:2011-08-28 21:55:24 // 分类:前端集合 // 访问: 3,447 次 // 热度:

最近在做一个Photo Gallery的javascript效果, 碰到这样一个错误:

error: expected identifier, string or number

自己去查看javascript代码时并没有看出什么问题.

然后Google一下才知道, 原来一般是由于多余的逗号引起的. 赶紧再去审查我的代码, 果然找到了一个多余的逗号:

image

当里面只有一行时, 后面的逗号完全可以不写.

把逗号去掉以后, 就没有再提示javascript错误了. 而且javascript功能也正常运行.

Tags: JavaScript, error, Expected identifier, string or number, js 错误

不用任何图片但是非常棒的CSS3 button>>  << Google更新了site link样式
Top