<!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>員工創(chuàng)建</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(){
//發(fā)送ajax查詢請求并處理
var?request?=?new?XMLHttpRequest();
request.open("GET","service.php?number="+document.getElementById("keyword").value);
request.send();
}
</script>
</body>
</html>

2016-11-13
客戶端代碼沒錯,3開頭為重定向問題,表示請求沒有成功,看下服務(wù)器端
2016-11-13
報的什么錯?
服務(wù)器端找問題,客戶端運行沒報錯。