属性列表后缺少} [英] missing } after property list
问题描述
我正在尝试在我的一个网站上使用jQuery实现内容滑块;但是我不断收到此错误:
I am trying to implement a content slider using jQuery in one of my website; however I keep getting this error:
missing } after property list
这是我的代码:
<script type='text/javascript'>
featuredcontentslider.init({
id: 'slider1',
contentsource: ['inline', ''],
toc: '#increment',
nextprev: ['prev', 'next'],
revealtype: 'click',
enablefade: [true, 0.1],
autorotate: [true, 3000]
});
</script>
当我在Firefox中单击查看源时,我发现缺少最后一个花括号,但是在文件中代码没问题,并且使用firebug调试控制台时出现了以下错误:
When I click on view source in Firefox I found that the last curly bracket is missing but in the file the code is fine, and using firebug debug console I got this error:
missing } after property list
我尝试了很多事情,搜索了缺少的逗号,消除了大部分内容,但是找不到问题的根源.
I tried many things, searched for missing commas, eliminate most of the lines but could not find the source of the problem.
Firebug指向此行:
Firebug points to this line:
});
是有错误的.
我刚刚检查了IE8,Chrome和firefox中的脚本,在所有三个浏览器中,我都得到了这样的代码:
I just checked the script in IE8, Chrome and firefox and in all of the three broweser i get the code like this:
<script type='text/javascript'>
featuredcontentslider.init({
id: 'slider1',
contentsource: ['inline', ''],
toc: '#increment',
nextprev: ['prev', 'next'],
revealtype: 'click',
enablefade: [true, 0.1],
autorotate: [true, 3000]
); <---- notice the missing bracket
</script>
我也只想这样写一行:
featuredcontentslider.init({ id: 'slider1' });
并仍然以相同的错误结束.在localhost中,脚本可以正常工作,但是在实际的网站中,脚本可以正常运行.
and still ended up with the same error. In localhost the script works fine, however in the actual website the script is functioning correctly.
我想知道页面中的其他js代码是否有可能影响这一行为?
I am wondering is there a possibility that other js code in the page might affect the behaviour of this one?
推荐答案
嗯...这闻起来有点像网站缓存错误.
Hmmm... this smells somewhat like a website cache error.
也许}
一次丢失了,即使您修复了它,您的网站仍在提供旧文件.
Perhaps the }
was missing at one time, and even though you fixed it, your website is still serving the old file.
您尝试过吗:
- 清除浏览器中的缓存? (以查看是否在浏览器端)
- 使用
curl
或wget
查看原始javascript文件(以查看服务器端缓存是否陈旧)
- clearing the cache in your browser? (to see if it's browser-side)
- using
curl
orwget
to view the raw javascript file (to see if there's a stale server-side cache)
这篇关于属性列表后缺少}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!