报错信息
1
ReferenceError: $ is not defined [详细了解]
1
2
3
4
5
6
<script type="text/javascript">
$(function () {
alert("OK");
});
</script>
<script type="text/javascript" src="js/jquery.min.js"></script>
修改办法,把JQuery代码放在引用JQuery文件引入的后面
1
2
3
4
5
6
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
alert("OK");
});
</script>