ajax请求页面跳转,但是没跳
我想点击“提交”按钮时,将spId和chint传到后台.do中执行写入数据库,然后页面跳转到评论列表页。现在的问题是:浏览器F12报Uncaught ReferenceError: $ is not defined错误,求解!!!
<script>
function check(){
var spId = ${param.spId};
var chint = document.getElementById("chint").value;
$.ajax({
type:"POST",
url:"/demo/comment/addComment.do",
data:"spId="+spId+"&chint="+chint,
async:"false",
success:function(data){
if(data.isSuccess){
window.location.href = "/demo/comment/queryCommentList.do";
}
}
});
}
</script>
<form method="post" action="">
<table width="100%" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
商品序号:${param.spId}
商品名称:${param.name}
</td>
</tr>
<tr>
<td align="center" width="100%">
<textarea rows="8" cols="50" id="chint" name="chint"></textarea>
</td>
</tr>
<tr>
<td align="center"><input type="button" value="提交" onclick="check();"></td>
</tr>
</table>
</form>