奇怪的Javascript错误
我有一个html页面,其中包含以下内容:奇怪的Javascript错误,javascript,Javascript,我有一个html页面,其中包含以下内容: <script language="javascript" type="text/javascript"> $(function() { BOOKS.init({ xmlPath : "http://localhost/project/books.xml", imgPath : "http://localhost/project/img/",
<script language="javascript" type="text/javascript">
$(function() {
BOOKS.init({
xmlPath : "http://localhost/project/books.xml",
imgPath : "http://localhost/project/img/",
perView : 6
});
)};
</script>
$(函数(){
BOOKS.init({
xmlPath:“http://localhost/project/books.xml",
imgPath:“http://localhost/project/img/",
监督:6
});
)};
然而“$(fun”决定消失并成为:
<script language="javascript" type="text/javascript">
ction() {
BOOKS.init({
xmlPath : "http://localhost/project/books.xml",
imgPath : "http://localhost/project/img/",
perView : 6
});
)};
</script>
动作(){
BOOKS.init({
xmlPath:“http://localhost/project/books.xml",
imgPath:“http://localhost/project/img/",
监督:6
});
)};
知道为什么吗?简,你的代码中有syntex错误。 函数()的右大括号在$的右大括号之前。使用下面的代码。我已经编辑过了
$(function() {
BOOKS.init({
xmlPath : "http://localhost/project/books.xml",
imgPath : "http://localhost/project/img/",
perView : 6
});
});
使用firebug for javascript:)您能再解释一下吗?你的意思是,你的.html文件看起来像第一块代码,但当你在live view中查看源代码时,它看起来像第二块代码?是的,我在Dreamweaver中编写的第一块代码。然而,当我通过浏览器和查看源代码查看时,第二块代码出现了。也许这是一个“dreamweaver的东西”。您能否在浏览器中查看与dreamweaver live视图相反的.html?我认为这是一个缓存错误?也许你需要清除浏览器缓存并重新加载页面。我希望我能否决dreamweaver