Rumah >pembangunan bahagian belakang >tutorial php >PHP与Ajax调用
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);