<!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>
</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="staffName"><br><br>
<label>请输入员工的编号:</label>
<input type="text" id="staffNumber"><br><br>
<label>请输入员工的性别:</label>
<select id="staffSex">
<option>男</option>
<option>女</option>
</select><br><br>
<label>请输入员工的职位:</label>
<input type="text" id="staffJob"><br><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>