未捕获的SyntaxError:意外的标记ILLEGAL

时间:2013-09-23 14:36:27

标签: javascript jquery

我正在将javascripts归档到外部文件。通过此过程,我在Chrome中遇到了以下错误:

未捕获的SyntaxError:意外的标记ILLEGAL Line:2

$(document).bgStretcher({
#if($CURRENTPAGE.pageId==23)

    images: ['/media/backgrounds/homepage/homepage.jpg'], imageWidth: 1860, imageHeight: 1000
    #else
        images: ['/media/backgrounds/Dreamjob_coachfoto_'+pad(randomnumber,3)+'.jpg'], imageWidth: 1860, imageHeight: 1000
    #end
    });

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:0)

正确的语法(图像上的语法看起来很奇怪,但我找不到bg担架的完整文档抱歉)

$(document).bgStretcher({
if($CURRENTPAGE.pageId==23) {

images: ['/media/backgrounds/homepage/homepage.jpg'], imageWidth: 1860, imageHeight: 1000
}  
 else   {
    images: ['/media/backgrounds/Dreamjob_coachfoto_'+pad(randomnumber,3)+'.jpg'],              imageWidth: 1860, imageHeight: 1000
 }
});

答案 1 :(得分:0)

使用Firefox进行调试(使用Firebug),它会在此类错误中为您提供比Chrome更多的信息。

相关问题