开发者

Weird Javascript error

I have a html page which has this js:

<script language="javascript" type="text/javascript"> 
$(function() { 
        BOOKS.init({ 
    开发者_如何学JAVA            xmlPath : "http://localhost/project/books.xml", 
                imgPath : "http://localhost/project/img/", 
                perView : 6 
        }); 
)}; 
</script> 

However "$(fun" decided to disappear and become:

<script language="javascript" type="text/javascript"> 
ction() { 
        BOOKS.init({ 
                xmlPath : "http://localhost/project/books.xml", 
                imgPath : "http://localhost/project/img/", 
                perView : 6 
        }); 
)}; 
</script>

Any idea why?


Jian, You have the syntex error in your code. Your closing brace of function() is before then closing brace of $. Use the below code. I have edited it.

$(function() { 
    BOOKS.init({ 
            xmlPath : "http://localhost/project/books.xml", 
            imgPath : "http://localhost/project/img/", 
            perView : 6 
    }); 
});

Use firebug for javascript :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜