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

PHP与Ajax调用

WBOY
Release: 2016-06-23 14:32:05
Original
1267 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template