幻灯片的 Javascript 语法错误
2014-10-06
574
我正在将我的网站转移到我自己的服务器上,我使用带有主题的免费在线服务构建了它。我下载了文件存档,但尝试使其工作时却出现错误。唯一不起作用的是 javascript 幻灯片,我有一个语法错误,无法找出问题所在。
这是代码:
< script type='text/javascript'>
(function (jQuery) {
function init() {
wSlideshow.render({
elementID: "401544824517155183",
nav: "numbers",
navLocation: "bottom",
captionLocation: "bottom",
transition: "slide",
autoplay: "1",
speed: "5",
aspectRatio: "auto",
showControls: "false",
randomStart: "true",
images: [{
"url”:”uploads/2/0/6/1/20616634/5573326.png", "width":"333",
"height": "208"
}, {
"url”:”uploads/2/0/6/1/20616634/6952116.png", "width": "400",
"height": "250"
}, {
"url”:”uploads/2/0/6/1/20616634/116529.png", "width": "400",
"height": "250",
"link": "/iosapplication.html"
}, {
"url”:”uploads/2/0/6/1/20616634/6185044.png", "width": "333",
"height": "208",
"link": "/puffinbook.html"
}, {
"url”:”uploads/2/0/6/1/20616634/6694718.png", "width": "333",
"height": "208",
"link": "/cyrenians.html"
}]
})
}
jQuery ? jQuery(init) : document.observe('dom:loaded', init)
})(window._W && _W.jQuery)
< /script>
有人能帮我吗?
谢谢
1个回答
仔细看,你写的是 ” 而不是 " 。使用以下脚本。
<script type='text/javascript'>
(function (jQuery) {
function init() {
wSlideshow.render({
elementID: "401544824517155183",
nav: "numbers",
navLocation: "bottom",
captionLocation: "bottom",
transition: "slide",
autoplay: "1",
speed: "5",
aspectRatio: "auto",
showControls: "false",
randomStart: "true",
images: [{
"url":"uploads/2/0/6/1/20616634/5573326.png", "width":"333",
"height": "208"
}, {
"url":"uploads/2/0/6/1/20616634/6952116.png", "width": "400",
"height": "250"
}, {
"url":"uploads/2/0/6/1/20616634/116529.png", "width": "400",
"height": "250",
"link": "/iosapplication.html"
}, {
"url":"uploads/2/0/6/1/20616634/6185044.png", "width": "333",
"height": "208",
"link": "/puffinbook.html"
}, {
"url":"uploads/2/0/6/1/20616634/6694718.png", "width": "333",
"height": "208",
"link": "/cyrenians.html"
}]
})
}
jQuery ? jQuery(init) : document.observe('dom:loaded', init)
})(window._W && _W.jQuery)
</script>
Rashmin Javiya
2014-10-06