zoukankan      html  css  js  c++  java
  • ajax提交的javascript代码

    var xhr=xhr();

    function xhr(){

          if(window.XMLHttpRequest){

                     return   window.XMLHttpRequest();

                    }else if(window.ActiveXObject){

                          return new ActiveXObject("Microsoft.XMLHTTP");

                    }catch(e){

                         try{

                                 return new ActiveXObject("Msxml2.XMLHTTP");

                            }catch (ex){}

                       }

                     }

                 }

                xhr.open("get","url","true");

               xhr.onreadystatechange=function(){

                      if(xhr.readyState==4&&(xhr.status==200||xhr.status==304)){

                                document.getElementById("myDiv").innerHTML=xhr.responseText;

                               }

                        }

                    xhr.send();

           

  • 相关阅读:
    宿主机无法访问CentOS7上Jenkins服务的解决办法
    415. Add Strings
    367. Valid Perfect Square
    326. Power of Three
    258. Add Digits
    231. Power of Two
    204. Count Primes
    202. Happy Number
    172. Factorial Trailing Zeroes
    171. Excel Sheet Column Number
  • 原文地址:https://www.cnblogs.com/suajiu9/p/6376133.html
Copyright © 2011-2022 走看看