国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開(kāi)通VIP
增加Ajax相關(guān)的js方法
增加Ajax相關(guān)的js方法,這些方法大部分是基于prototype (一個(gè)很好的 JavaScript Framework )類庫(kù)來(lái)寫的。
1. loadAjaxElement,loadAjaxData,sendAjaxElement,sendAjaxData這四方法都是真接Ajax操作的方法;
2. parseXML,importXML,getTextNodeValue這三個(gè)方法是對(duì)于Ajax返回結(jié)果中的xml數(shù)據(jù)的處理;如果返回結(jié)果非標(biāo)準(zhǔn)xml文檔的話,可以通過(guò)parseXML來(lái)處理,生成XMLDocument對(duì)象;
3.getParams方法是用來(lái)返回當(dāng)前頁(yè)面的url參數(shù)值的;
4.showLoading,hideLoading這兩個(gè)方法用來(lái)顯示在頁(yè)面加載過(guò)程中提示信息;

//Ajax功能;
function loadAjaxElement(e,u,p,f,l){
    if(arguments.length < 3){
        return ;
    }
    var o = $(e);
    o.innerHTML = l;
    if(typeof p != ‘string‘){
        p = $H(p).toQueryString();
    }
    new Ajax.Updater( {success: e},u,{method: ‘get‘, parameters: p, onFailure: f});
}
function loadAjaxData(u,p,s,f){
    if(arguments.length < 3){
        return ;
    }
    if(typeof p != ‘string‘){
        p = $H(p).toQueryString();
    }
    new Ajax.Request( u,{method: ‘get‘, parameters: p, onSuccess:s,onFailure: f});
}
function sendAjaxElement(e,u,p,f,l){
    if(arguments.length < 3){
        return ;
    }
    var o = $(e);
    o.innerHTML = l;
    if(typeof p != ‘string‘){
        p = $H(p).toQueryString();
    }
    new Ajax.Updater( {success: e}, u, {method: ‘post‘, parameters: p, onFailure: f});
}
function sendAjaxData(u,p,s,f){
    if(arguments.length < 3){
    return ;
    }
    if(typeof p != ‘string‘){
        p = $H(p).toQueryString();
    }
    new Ajax.Request( u, {method: ‘post‘, parameters: p, onSuccess:s,onFailure: f});
}
function parseXML(s){
    try{
        var domParser = new DOMParser();
        var o = domParser.parseFromString(s, ‘a(chǎn)pplication/xml‘);
        return o.documentElement;
    }catch(e){
        try{
            var o = getIEXmlAX();
            o.loadXML(s);
            return o.documentElement;
        }catch(e){
            return null;
        }
    }
}
function importXML(u,s,f){
    new Ajax.Request( u, {method: ‘get‘, parameters: null, onSuccess:function(v){s(v.responseXML.documentElement);},onFailure: f});
}
function getIEXmlAX(){
    var i,activeXarr;
    activeXarr = new Array(
                                "MSXML4.DOMDocument",
                                "MSXML3.DOMDocument",
                                "MSXML2.DOMDocument",
                                "MSXML.DOMDocument",
                                "Microsoft.XmlDom"
    );

    for(i=0; i<activeXarr.length; i++){
        try {
            var o = new ActiveXObject(activeXarr[i]);
            return o;
        } catch(objException){}
    }
    return false;
}
function getTextNodeValue(d,n,e){
    if(typeof e == ‘undefined‘){
        e = false;
    }
    var a = d.getElementsByTagName(n);
    if(a==null){
        return null;
    }
    if(a.length==1){
        return (e)?unescape(a[0].firstChild.nodeValue):a[0].firstChild.nodeValue;
    }else{
        var ra = new Array();
        for(var i=0;i<a.length;i++){
            ra[i] = (e)?unescape(a[i].firstChild.nodeValue):a[i].firstChild.nodeValue;
        }
        return ra;
    }
}
function getParams(){
    var o = new Object()
    var a=document.location.search.substr(1).split(‘&‘);
    for (i=0;i<a.length;i++){
        try{
            var aa=a[i].split(‘=‘);
            var n=aa[0];
            var v=aa[1];
            o[n]=trim(v);
        }catch(e){
        }
    }
    return o;
}
function showLoading(c,b,a){
    switch(arguments.length){
        case 2:
            a = 0.9;
        case 1:
            b = "#000000";
        case 0:
            c = "#FFFFFF";
        break;
    }
    var d = document;
    if($("loading_div") == null){
    var s = ‘<div id="loading_div" style="position:absolute;left:0px;top:0px;width:100%;height:100%; z-index:auto;text-align: center;font-family: Courier New, Courier, mono;font-size: 12px;color:‘+c+‘;padding-top: 30%;background-color:‘+b+‘;"><h1>正在加載頁(yè)面...</h1></div>‘;
    d.write(s);
    }
    var o = $("loading_div");
    if(o.style.MozOpacity){
        o.style.MozOpacity = a;
    }else if(o.style.opacity){
        o.style.opacity = a;
    }else{
        a = a * 100;
        o.style.filter=‘Alpha(Opacity=‘+a+‘)‘;
    }
}

function hideLoading(){
    $("loading_div").style.display = ‘none‘;
}

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
JS框架
js 現(xiàn)在word
javascript使用ajax請(qǐng)求具體步驟
AjaxPro 內(nèi)部機(jī)制探討
jQuery之a(chǎn)jax實(shí)現(xiàn)篇
jquery cookie的用法 -
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服