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();

           

  • 相关阅读:
    树世界
    清空 NumericUpDown
    没有评论的日子
    GetData.cs

    Hashtable 在程序中控制重复项
    Convert.ToInt32() VS System.Int32.Parse()
    饮食九要素
    添加 or 修改 的一个处理方式
    一个关于 电话号码 的正则表达式
  • 原文地址:https://www.cnblogs.com/suajiu9/p/6376133.html
Copyright © 2011-2022 走看看