zoukankan      html  css  js  c++  java
  • 原始AJAX代码

    AJAX("POST"
        ,
    "/shared/ete2/submitschool.asp"
        ,
    "xml="+encodeURIComponent(xml.xml),
        
    function(msg){
            
    var f=window.document.frames["bgPage"];
            f.document.write(
    "<body>"+msg.xml.toString()+"</body>");
            healthCheckNew();
        });


    function AJAX(type,url,data,callback){
        
    var request = false;
        
    try {
            request 
    = new XMLHttpRequest();
        } 
    catch (trymicrosoft) {
         
    try {
            request 
    = new ActiveXObject("Msxml2.XMLHTTP");
         } 
    catch (othermicrosoft) {
           
    try {
                request 
    = new ActiveXObject("Microsoft.XMLHTTP");
           } 
    catch (failed) {
                request 
    = false;
           }  
         }
        }
        
    if (!request)    return;
        
        request.open(type, url, 
    true);
        request.setRequestHeader(
    "CONTENT-TYPE","application/x-www-form-urlencoded");
        request.setRequestHeader(
    "Content-Length",data.length);

        request.onreadystatechange 
    = function(){
            
    if(request.readyState == 4) {
                
    if(request.status == 200) {
                    callback(request.responseXML);
                } 
             }
        };
        request.send(data);
        
    }
  • 相关阅读:
    让GoogleCode的SVN下的HTML文件在FireFox下正常显示
    添加验证控件出错
    【转载】SQLServer中char、varchar、nchar、nvarchar的区别:
    人生第一篇博客
    二叉排序树
    最小编辑距离
    面试题集锦_4
    面试题集锦_3
    键树
    B树
  • 原文地址:https://www.cnblogs.com/200325074/p/1961136.html
Copyright © 2011-2022 走看看