Home  >  Article  >  Backend Development  >  PHP与Ajax调用

PHP与Ajax调用

WBOY
WBOYOriginal
2016-06-23 14:32:051215browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP书籍推荐Next article:[译]Speeding up your PHP scripts