<html>
<head><title>test</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
</script>
<!-- ERROR IS HERE the jquery is not being loaded -->
<script type="text/javascript" src="js/jquery.prettyPhoto.js">
</script>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css"
media="screen" charset="utf-8" />
</head>
<body>
<a title="Despicable Me" rel="prettyPhoto[movies]"
href="http://trailers.apple.com/mymovie.mov?width=640&height=360">
<img src="images/thumbnails/quicktime-logo.gif" alt="Despicable Me"
width="50" />
</a>
<a title="Despicable Me" rel="prettyPhoto[movies]"
href="ai.mov?width=640&height=360">
<img src="images/thumbnails/quicktime-logo.gif"
alt="Despicable Me" width="50" />
</a>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
</body>
</html>
當我打開這個網站在Firefox中,錯誤控制檯會返回一個錯誤:JavaScript錯誤:jQuery是沒有定義
jQuery is not defined.
的HTML文件,js文件,以及CSS文件都在同一文件夾。我究竟做錯了什麼?
究竟是什麼src =「// ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js」路徑 –
檢查chrome中的網絡標籤以查看jquery是否正在下載正確 –
jquery路徑是錯誤的。沒什麼嚴肅的,寒意 – defau1t