Js之AJAX

var xmlHttp;

         function createHttp() {

             try {

                 xmlHttp = new XMLHttpRequest();

             } catch (e) {

                 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

             }

         }

 createHttp();

             xmlHttp.onreadystatechange = function () {

                 if (xmlHttp.status == 200 && xmlHttp.readyState == 4) {

 

                     var data = xmlHttp.responseText;

                     document.getElementById("div1").innerHTML = data;

                 }

             }

             xmlHttp.open("get", "HandlerData.ashx");

             xmlHttp.send();

posted @ 2016-10-23 22:40  路边有一棵草  阅读(104)  评论(0编辑  收藏  举报