日期:2014-05-16  浏览次数:20367 次

看看这个错误、、急急急!!!
<html>
<head>
<script type="text/javascript" src="../js/jquery-1.4.min.js"></script>
GET http://localhost:8080/js/jquery-1.4.min.js 404 (/js/jquery-1.4.min.js) //这个是报错信息
<script type="text/javascript">
//表示表单各项是否通过检查
//通过检查设置为true,否则设置为false
var checkflag = {
"no" : false
};
$(function() {
Uncaught ReferenceError: $ is not defined//这个也是报错信息
//任务编号检查
checkflag.no=false;
$("#taskNo").blur(function() {
var no = $("taskNo").val();
$("#no_error").html("");
if (no == "") {
$("#no_error").html("任务编号不能为空");
alert("test");
} else {
//唯一性
//发送ajax
$.post("taskNo.action", {
"no" : no
}, function(ok) {
if (ok) {
checkflag.code = true;
$("#no_error").html("可以使用");
} else {
$("#no_error").html("任务编号重复");
}
});
}
});
});
//form 的on submit事件
$(function() {
$("#f").submit(function() {
$("#taskNo").blur();
alert("submit");
return checkflag.no;
});
});
</script>

------解决方案--------------------
GET http://localhost:8080/js/jquery-1.4.min.js 404 (/js/jquery-1.4.min.js) //这个是报错信息
楼上这是js没引用到,是路径问题吧
Uncaught ReferenceError: $ is not defined//这个也是报错信息
jquery没加载出来 肯定报$ is not defined还是看看src="../js/jquery-1.4.min.js路径对不对
------解决方案--------------------
探讨

文件存在呢、、我都换了好久个了、路径我用了绝对路径也不行

------解决方案--------------------
src="../js/jquery-1.4.min.js"看你这路径应该是js这个文件夹就在项目中,引用这个js的页面在另外一个文件中了吧,那你试试<script type="text/javascript" src="../js/jquery-1.4.min.js"></script>
换成<script type="text/javascript" src="http://localhost:8080/js/jquery-1.4.min.js "></script>
然后页面加载出来了F12一定要查看下jquery-1.4.min.js这个js脚本代码加载出来没