zoukankan      html  css  js  c++  java
  • html请求_ashx.cs页码Example

      

    //1创建对象 XMLHttpRequest   

          var request = createXHR();

            function createXHR() {//判断浏览器兼容             var xhr;    

             if (XMLHttpRequest) {      

               xhr = new XMLHttpRequest();   

              } else {      

               xhr = new ActiveXObject("Microsoft.XMLHTTP");   

              }         

        return xhr;        

    }    

         function send() {

                document.getElementById("d").innerHTML = "加载中...";       

          //2初始化         

        request.open("get", "02_getTime.ashx?_=" + Math.random(), true);     

            //3注册事件       

          request.onreadystatechange = function () {

                    if (request.readyState == 4) {

                        if (request.status == 200) {    

                         var res = request.responseText;     

                        document.getElementById("d").innerHTML = res;    

                     } else {                

             document.getElementById("d").innerHTML = "服务器内部错误";       

                  }

                    }     

            }    

             //4.发送请求     

            request.send();       

      }

  • 相关阅读:
    Jenkins的多个任务并串联参数传递
    jenkins任务构建失败重试插件Naginator Plugin
    通过hive向写elasticsearch的写如数据
    Elasticsearch中的索引管理和搜索常用命令总结
    Elasticsearch安装
    运行 Spark on YARN
    Jenkins console输出乱码???
    spark的standlone模式安装和application 提交
    多种排序算法整理
    结构型模式(二)
  • 原文地址:https://www.cnblogs.com/nqsan/p/3373823.html
Copyright © 2011-2022 走看看