XMLHttpRequest.setRequestHeader

来源:互联网 发布:php 去掉斜线 编辑:程序博客网 时间:2024/06/05 23:43
       var xmlHttp = createXMLHttp();
                xmlHttp.open("Post", "GetPrice.ashx", true);
                xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
                xmlHttp.onreadystatechange = function() {
                    if (xmlHttp.readyState == 4) {
                        if (xmlHttp.status == 200) {
                            document.getElementById("Text2").value = xmlHttp.responseText;
                        }
                    }
                };
                xmlHttp.send("name=" + name);