我試圖檢查我的Jquery庫是否加載到我的HTML頁面上。我正在檢查它是否有效,但有些不對。以下是我有:檢查是否使用Javascript加載jquery
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="/query-1.6.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
if (jQuery) {
// jQuery is loaded
alert("Yeah!");
} else {
// jQuery is not loaded
alert("Doesn't Work");
}
});
</script>
不要在「$(document).Ready」中使用大寫字母R' – Serigan
'alert(window。$?1:0)' – Thielicious