zoukankan      html  css  js  c++  java
  • XMLHttpRequest IHttpHandler二

            var introId=document.getElementById("txtIntroId").value;
            var request;
            try
            {  
                request = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e)
            {
               try
               {
                    request = new ActiveXObject("Microsoft.XMLHTTP");
               }
               catch(e)
               {
                    try
                    {
                    }
                    catch(e)
                    {
                        request = new XMLHttpRequest();
                    }
               }
            }
            request.open("post","../Handler.ashx",true);
            request.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"); //设置编码
            request.send("userId="+introId);
            request.onreadystatechange=function()
            {
                if(request.readyState==4)
                {
                   if(request.responseText=="0")
                   {
                    document.getElementById('msg_IntroId').innerHTML="介绍人会员编号输入有误";
                   }
                   else
                   {
                    document.getElementById('msg_IntroId').innerHTML="介绍人会员编号可用";
                   }
                }
            }
  • 相关阅读:
    [转]十步完全理解SQL
    [转]Java日期时间使用总结
    [转]Mybatis出现:无效的列类型: 1111 错误
    [转]java.lang.OutOfMemoryError: PermGen space及其解决方法
    [转]Spring3核心技术之事务管理机制
    [转]Spring的事务管理难点剖析(1):DAO和事务管理的牵绊
    设计模式之装饰模式
    进程通信
    设计模式之备忘录模式
    设计模式之单例模式
  • 原文地址:https://www.cnblogs.com/htht66/p/1142688.html
Copyright © 2011-2022 走看看