为了账号安全,请及时绑定邮箱和手机立即绑定

xmlhttprequest怎么发送soap请求

xmlhttprequest怎么发送soap请求

呼唤远方 2018-12-31 00:00:26
xmlhttprequest怎么发送soap请求
查看完整描述

1 回答

?
qq_遁去的一_1

TA贡献1725条经验 获得超7个赞

Response.Write();//在页面输出

//ajax代码
function createXMLHttpRequest() {
if (window.ActiveXObject) {//如果是IE浏览器
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {//非IE浏览器
return new XMLHttpRequest();
}
}

var xhr = null;
function ChicKUserName() {
var name = document.getElementById("txtUserName").value;
//请求字符器
var url = "LoginUserName.aspx?UserName=" + name;
//1.创建XMLHttpRequest
xhr = createXMLHttpRequest();
//2.设置回调函数
xhr.onreadystatechange = readyDo;
//3.初始化XMLHttpRequest组件
xhr.open("get", url, true);
//4.发送请求
xhr.send(null);
}

function readyDo() {
if (xhr.readyState==4&&xhr.status==200) {
var result = xhr.responseText;
//对返回结果进行处理
if (result == "true") {
document.getElementById("div1").innerHTML="用户名已存在";
}
else {
document.getElementById("div1").innerHTML = "用户名可以使用";
}
}
}



查看完整回答
反对 回复 2019-01-17
  • 1 回答
  • 0 关注
  • 604 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信