Uncaught ReferenceError: $ is not defined
頁面尚未載入 jQuery 函式庫,或載入路徑錯誤、順序錯誤(在 jQuery 載入前就使用了 $)。
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
integrity="sha256-..." crossorigin="anonymous"></script>
<script src="/js/jquery-3.7.1.min.js"></script>
<script> 必須置於所有使用 $ 的腳本之前。<script src="jquery.js"></script>
<script src="prototype.js"></script>
<script>
var $j = jQuery.noConflict(); // 釋放 $ 給 prototype
$j(document).ready(function(){ $j("div").hide(); });
</script>
typeof jQuery 應回傳 "function"。