PHP与Ajax调用
程序员文章站
2022-05-05 10:14:05
...
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);
//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);