zoukankan      html  css  js  c++  java
  • 小小ajax

    <html>

    <head>

    <title>XMLHTTPRequest对象的说明DEMO</title>

    <script language="javascript" type="text/javascript">

    var xmlhttp;

    function createXMLHTTPRequext(){

          if(window.ActiveXObject) {

               xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');

       }

        else if(window.XMLHTTPRequest){

           xmlhttp = new XMLHTTPRequest();

        }

    }

    function PostOrder(xmldoc)

    {

        createXMLHTTPRequext();

    }

    function HandleStateChange()

    {

       

        if (xmlhttp.readyState == 4){

           document.frmTest.myButton.disabled = false;

           alert(xmlhttp.responseBody);

           alert(xmlhttp.responseStream);

           alert(xmlhttp.responseText);

           alert("Result = " + xmlhttp.responseXML.xml);

           alert(xmlhttp.status);

           alert(xmlhttp.statusText);

        }

    }

    </script>

    </head>

    <body>

    <form name="frmTest">    

    <input name="myButton" type="button" value="ClickMe" onclick="PostOrder('http://localhost/example.htm');">

    </form>    

    </body>

    </html>

  • 相关阅读:
    使用GitHub建立自己的个人主页
    学习Linux第二天
    学习Linux第一天
    网页布局基础
    HTML弹出窗口
    CSS进阶
    HTML+CSS入门
    廖老师JavaScript教程高阶函数-sort用法
    获取页面的title值
    if...else...这段代码打印结果,并简述其理由
  • 原文地址:https://www.cnblogs.com/jcomet/p/1242810.html
Copyright © 2011-2022 走看看