聪明文档网

聪明文档网

最新最全的文档下载
当前位置: 首页> 正在进行安全检测...

正在进行安全检测...

时间:2023-12-12 02:00:33    下载该word文档
js建立XMLHttpRequest对象及其属性和方法1.//定义变量,存储对象2.varxmlHttp;3.//创建XMLHttpRequest对象4.functioncreatXMLHttpRequest(5.{6.if(window.ActiveXObject7.{8.xmlHttp=newActiveXObject("Microsoft.XMLHTTP";9.}10.elseif(window.XMLHttpRequest11.{12.xmlHttp=newXMLHttpRequest(;13.}14.}15.//使用get方式建立与后台的交互16.functioncallServer(17.{18.creatXMLHttpRequest(19.varemail=document.getElementById("TxtEmail".value;20.if(email==""21.{22.document.getElementById("LabMsg".innerText="请输入邮箱!";23.document.getElementById("LabMsg".style.color="red";24.}25.else26.{27.url="register.aspx?email="+email+"&ts"+newDate(.getTime(;28.xmlHttp.onreadystatechange=handleStateChange;29.xmlHttp.open("GET",url,true;30.xmlHttp.send(null;31.}32.}33.//回调函数,后台处理完结果后返回给回调函数34.functionhandleStateChange(35.{36.//请求的状态有5个值:0=未初始化;1=正在加载;2=已经加载;3=交互中;4=成;37.if(xmlHttp.readyState==438.{
39.//200对应OK,如404=未找到网页40.if(xmlHttp.status==20041.{42.varresult=xmlHttp.responseXML.getElementsByTagName("result"[0].firstChild.nodeValue;43.if(result=="true"44.{45.document.getElementById("LabMsg".innerHTML="恭喜,可用!";46.document.getElementById("LabMsg".style.color="red";47.}48.elseif(result=="false"49.{50.document.getElementById("LabMsg".innerText="该邮箱已存在!";51.document.getElementById("LabMsg".style.color="red";52.}53.}54.}55.}56.57.post请求58.url="register.aspx?email="+email+"&ts"+newDate(.getTime(;59.xmlHttp.onreadystatechange=handleStateChange;60.xmlHttp.open("POST",url,false;61.xmlHttp.SetRequestHeader("Content-Type","application/x-www-form-urlencoded";62.xmlHttp.send(null;//定义变量,存储对象varxmlHttp;//创建XMLHttpRequest对象functioncreatXMLHttpRequest({if(window.ActiveXObject{xmlHttp=newActiveXObject("Microsoft.XMLHTTP";}elseif(window.XMLHttpRequest{xmlHttp=newXMLHttpRequest(;}}//使用get方式建立与后台的交互functioncallServer({creatXMLHttpRequest(varemail=document.getElementById("TxtEmail".value;if(email==""{后台处理请求的代码:viewplaincopytoclipboardprint?1.//写在所请求的URL页面的page_load2.stringemail;3.email=Request.QueryString["email"];4.myCustomer.Email=email;

免费下载 Word文档免费下载: 正在进行安全检测...

  • 29.8

    ¥45 每天只需1.0元
    1个月 推荐
  • 9.9

    ¥15
    1天
  • 59.8

    ¥90
    3个月

选择支付方式

  • 微信付款
郑重提醒:支付后,系统自动为您完成注册

请使用微信扫码支付(元)

订单号:
支付后,系统自动为您完成注册
遇到问题请联系 在线客服

常用手机号:
用于找回密码
图片验证码:
看不清?点击更换
短信验证码:
新密码:
 
绑定后可用手机号登录
请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系 在线客服