点击查询按钮没有反应,一切按老师步骤来的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo</title>
<style>
*{
font-size:16px;
line-height:1.8;
}
</style>
</head>
<body>
<h1>员工查询</h1>
<label>请输入员工编号:</label>
<input type="text" id="keyword">
<button id="search">查询</button>
<p id="searchResult"></p>
<h1>员工创建</h1>
<label>请创建员工姓名:</label>
<input type="text" id="stuffName"></br>
<label>请创建员工编号:</label>
<input type="text" id="stuffNumber"></br>
<label>请选择员工性别:</label>
<select id="stuffSex"></br>
<option>男</option>
<option>女</option>
</select></br>
<label>请输入员工职位:</label>
<input type="text" id="stuffJob"></br>
<button id="save">保存</button>
<p id="createResult"></p>
<script>
document.getElementById("search").onclick=function(){
//发送ajax查询请求并处理
var request=new XMLHttpRequest();
request.open("GET","service.php?number="+document.getElementById("keyword").value);
request.send();
}
</script>
</body>
</html>