zoukankan      html  css  js  c++  java
  • 通过GET方式进行Ajax操作;


    var xhr;
            window.onload = function () {
                xhr = createXmlHttp();
            }
            function doAjax() {
                xhr.open("GET", "Ajax.aspx?isAjax=1", true);
                xhr.onreadystatechange = watching;
                xhr.send(null);
            }
            function watching() {
                if (xhr.readyState==4) {
                    if (xhr.status == 200) {
                        var txt = xhr.responseText;
                        document.getElementById("hh").innerHTML = txt;
                    }
                }
                else {
                    document.getElementById("hh").innerHTML="服务器出错了"+xhr.status;
                }
            }

  • 相关阅读:
    理解原型Prototype、继承
    解决js跨域问题的基本方法之 -------JSONP
    CSS3中动画效果Transitions与Animations的区别
    支付宝支付实例
    上线实例
    Celery
    Redis
    git
    jwt认证
    登录认证
  • 原文地址:https://www.cnblogs.com/msdncrazy/p/2974427.html
Copyright © 2011-2022 走看看