按钮不响应怎么解决?
$(function() { //该函数包括的部分,会在页面加载完全后执行,与 window.onload 事件类似
$("#back").click(function() { //返回按钮事件
location.href = "welcome.html";
});
$("#search").click(function(){
var deptno = $("#deptno").val(); //该函数可以获取用户输入的部门编号
var res = query("select * from emp where deptno=" + deptno + ""); //组装SQL语句并执行查询
if(res != null){ //判断是否有返回值
//var res_2=query("select * from emp where deptno=" + deptno + ");
sessionStorage['deptno'] = deptno; //deptno是要查看员工的部门的编号,把该编号放入sessionStorage,
location.href = "get_dep_emp.html";
}
});
});
</script>
</head>
<body>
<div class="content">
<h2 class="title">查询部门员工</h2>
<hr />
<table width="90%" align="center" class="tablelist">
<tr>
<td width="45%" align="right">部门编号:</td>
<td><input type="text" id="deptno" /></td>
</tr>
<td colspan="2" align="center">
<input type="submit" value=" 查询 " id="search" class="button" />
<input type="button" value=" 返回 " id="back" class="button" />
</td>
</table>
</div>
</body>
但是查询和返回两个按钮都没有响应。。纯属菜鸟,请大神指点