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 :)
精彩评论