YH.key 发表于 2013-1-23 02:17:33

ajax头提示

定义头

var xmlHttp;

function createXMLHttpRequest() {
    if (window.ActiveXObject) {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();
    }
}
function startRequest() {
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = handleStateChange;
    xmlHttp.open("GET", "innerHTML.xml", true);
    xmlHttp.send(null);
}



function handleStateChange() {

    if(xmlHttp.readyState == 4) {

      if(xmlHttp.status == 200) {

            方法调用();
      }

    }

}
页: [1]
查看完整版本: ajax头提示