PHP与Ajax调用
时间:2021-07-01 10:21:17
帮助过:4人阅读
var url = "../IPSearch.php";//要发送到的URL
//alert(document.getElementById("DepCode").value);
//alert(document.getElementById("QueryType").value);
var queryString ="DeptCode"+ "=" +DeptCode;
queryString+= "&QueryType" + "=" + QueryType;//如果有多个参数需要传递,则用&符号连接
xmlHttp.open("post", url, true);
xmlHttp.onreadystatechange = showIPSearchResult;
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
xmlHttp.send(queryString);