2014-02-24 23 views
-1

我剛剛學習jQuery和頁面下面的代碼不加載。任何幫助將不勝感激。與jQuery頁面不

<!DOCTYPE html> 
<html> 
<head> 
<title>First jQuery-Enabled Page</title> 
<script type="text/javascript" src="jquery-1.11.0.js"></script> 
<script type="text/javascript"> 
    $("document").ready(function() { 
     alert("The page just loaded!"); 
    }); 
</script> 
</head> 
<body> 

</body> 
</html> 
+5

你有一個叫做'jquery-1.11.0.js'的文件在這個文件的同一位置嗎? –

+1

,請閱讀這個 - > https://developers.google.com/chrome-developer-tools/docs/console,你可以找到像這樣的小錯誤真的很快 – jycr753

+1

因爲你剛開始我會用鏈接到他的最新縮小文件是'http:// code.jquery.com/jquery.min.js'也有'$(「document」)'這是告訴查詢選擇標籤文檔你的意思只是使用'$(document)' – Mouseroot

回答

0
$(document).ready(function() { 
alert("The page just loaded!"); 
}); 

從各地文檔中的jQuery選擇刪除引號。

+1

它可以使用或不使用引號:[看到這個jsFiddle](http://jsfiddle.net/m8XGG/) –

+1

這不是一個問題:http://jsbin.com/femavosu/1/edit – dfsq