ajax下拉联动源码,AJAX级联,AJAX联动

 var xmlHttp;
function CreateXmlHttp()
{
    try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
    catch(e){try{xmlHttp=new XMLHttpRequest();}
    catch(e){xmlHttp=false;}}}
}
function AjaxProcess(url,id)
{
    CreateXmlHttp();   
    xmlHttp.open("POST",url);
    xmlHttp.onreadystatechange=function()
    {
        $(id).innerHTML="<div  class='resear'><div style='background:url(images/loader.gif) no-repeat 15px center;padding:20px;text-indent:25px;color:#009900;font-size:14px; font-weight:bold;'>数据加载中,请稍候...</div></div>"
        if(xmlHttp.readyState==4)
        {
            $(id).innerHTML="<div  class='resear'>"+xmlHttp.responseText+"</div>";         
        }          
    }
    xmlHttp.send(null);
}

posted @ 2009-04-11 19:24  Defonds  阅读(16)  评论(0编辑  收藏  举报