首页 > Web开发 > 详细

Ajax - XMLHTTP实例

时间:2019-03-23 13:47:28      阅读:140      评论:0      收藏:0      [点我收藏+]

url:http://localhost/index.htm

<html>
<head>
    <title>Ajax</title>
    <script type="text/javascript">
        function LoadContent()
        {
            var x;
            x = new ActiveXObject("Microsoft.XMLHTTP");
            x.onreadystatechange = function ()
            {
                document.getElementById("div1").innerHTML = x.responsetext;               ;
            }
            x.open("GET","http://www.liveinau.com/migrate/2606.html",true);
            x.send();
        }
    </script>
</head>
<body>
    <form>
        <input id="Button1" type="button" value="button" onclick="LoadContent()"/>
    </form>
    <br />
    <div id="div1">占位符</div>
</body>
</html>

  

Ajax - XMLHTTP实例

原文:https://www.cnblogs.com/ryueifu-VBA/p/10583589.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!