首頁  >  文章  >  後端開發  >  PHP与Ajax调用

PHP与Ajax调用

WBOY
WBOY原創
2016-06-23 14:32:051217瀏覽

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);

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn