首页  >  文章  >  后端开发  >  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