頁面調試時,明明引入了JQ文件,卻一直提示Uncaught ReferenceError: jQuery is not defined錯誤。
轉自:http://blog.csdn.net/baicp3/article/details/25419977
-
js路徑問題,確保script的src引用路徑正確
-
頁面jquery.js的引用位置問題,如果導入了其它與jquery有關的js文件,那么jquery.js須在其它js的前面
錯誤引用位置
<script type="text/javascript" src="js/jquery-ui-1.10.4.custom.js"></script>
<script type="text/javascript" src="js/jquery-1.10.2.js"></script
正確引用位置
<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.4.custom.js"></script>