XMLHttpRequest post 提交 数据

阅读更多

XMLHttpReq.open("POST", "/formservlet", false);
    content='Id=' + Id + '&Name=' + Name
            + '&No=' + No;
    XMLHttpReq.setRequestHeader("Content-Type",
            "application/x-www-form-urlencoded");
     XMLHttpReq.setRequestHeader("Content-Length", content.length);
    XMLHttpReq.onreadystatechange = function() {
        if (XMLHttpReq.readyState == 4) {
            if (XMLHttpReq.status == 200) {
                alert(XMLHttpReq.responseText);
            }
        }
    }
    XMLHttpReq.send(content);

你可能感兴趣的:(XMLHttpRequest post 提交 数据)