最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

163 AJAX Tab

 更新時間:2007年01月23日 00:00:00   作者:  

復(fù)制代碼 代碼如下:

// 163 AJAX Tab  
// update 2006.10.18 
// 增加鼠標(biāo)延遲感應(yīng)特性。 
// update 2006.10.8 
// A 標(biāo)簽 href 屬性將保持原有HTML功能。增加urn屬性為AJAX Load 路徑。 
// update 2006.10.11 
// 修正IE5.0 undefined 未定義錯誤,增加腳本錯誤屏蔽 
var Browser = new Object(); 
Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument!='undefined'); 
Browser.isIE = window.ActiveXObject ? true : false; 
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1); 
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1); 
if (Browser.isFirefox) { // entend Event Mod for FireFox 
    extendEventObject(); 

function extendEventObject() { 
    Event.prototype.__defineGetter__("srcElement", function () { 
        var node = this.target; 
        while (node.nodeType != 1) node = node.parentNode; 
        return node; 
    }); 

    Event.prototype.__defineGetter__("fromElement", function () { 
        var node; 
        if (this.type == "mouseover") 
            node = this.relatedTarget; 
        else if (this.type == "mouseout") 
            node = this.target; 
        if (!node) return; 
        while (node.nodeType != 1) node = node.parentNode; 
        return node; 
    }); 

    Event.prototype.__defineGetter__("toElement", function () { 
        var node; 
        if (this.type == "mouseout") 
            node = this.relatedTarget; 
        else if (this.type == "mouseover") 
            node = this.target; 
        if (!node) return; 
        while (node.nodeType != 1) node = node.parentNode; 
        return node; 
    }); 

function IsChild(cNode,pNode){ 
    while(cNode!=null){ 
        cNode=cNode.parentNode; 
        if(cNode==pNode) return true;  
    } 
    return false; 


var ajccache=new Object(); 
var waitInterval; 
var tempref; 
var MouseDelayTime=150;//鼠標(biāo)感應(yīng)延遲300毫秒 
function getTBprefixName(str,sta){ 
    if(str.indexOf("active")!=-1 || str.indexOf("normal")!=-1) str=str.substr(6); 
        else if(str.indexOf("over")!=-1) str=str.substr(4); 
            else str=""; 
    return sta+str; 

function startajaxtabs(){ 
    for(var i=0;i<arguments.length;i++) 
    { 
        var ulobj=document.getElementById(arguments[i]); 
            ulist=ulobj.getElementsByTagName("li");             
            for(var j=0;j<ulist.length;j++) 
            { 
                var thelist=ulist[j]; 
                if(thelist.parentNode.parentNode!=ulobj) continue;//只有第一層li有效 fixed 2006.9.29 
                var ulistlink=thelist.getElementsByTagName("a")[0]; 
                var ulistlinkurl=ulistlink.getAttribute("urn"); 
                var ulistlinktarget=ulistlink.getAttribute("rel"); 
                thelist.setActive=function(bactive){ 
                    if(bactive){ 
                        this.status="active"; 
                        this.className=getTBprefixName(this.className,"active"); 
                    }else{ 
                        this.status="normal"; 
                        this.className=getTBprefixName(this.className,"normal"); 
                    } 
                } 
                thelist.LoadTab=function(){ 
                    this.setActive(true); 
                    this.parentNode.parentNode.activetab.setActive(false); 
                    this.parentNode.parentNode.activetab=this;                     
                    var ulistlink=this.getElementsByTagName("a")[0]; 
                    loadAJAXTab(ulistlink.getAttribute("urn"),ulistlink.getAttribute("rel")); 
                } 
                thelist.onmouseover=function(aEvent){ 
                    var myEvent = window.event ? window.event : aEvent; 
                    var fm=myEvent.fromElement; 
                    if(IsChild(fm,this) || fm==this) return;//過濾子元素event 
                    if(this.status=="active") return; 
                    tempref=this; 
                    clearTimeout(waitInterval); 
                    waitInterval=window.setTimeout("tempref.LoadTab();",MouseDelayTime); 
                } 

                thelist.onmouseout=function(aEvent){ 
                    var myEvent = window.event ? window.event : aEvent; 
                    var em=myEvent.toElement; 
                    if(IsChild(em,this) || em==this) return; //過濾子元素event 
                    if(this.status=="active") return; 
                    clearTimeout(waitInterval); 
                } 

                if(ulistlinkurl.indexOf("#default")!=-1){ 
                    thelist.setActive(true); 
                    ulobj.activetab=thelist; 
                    ajccache[ulistlinkurl]=getElement(ulistlinktarget).innerHTML; 
                }else{ 
                    thelist.setActive(false); 
                } 

            } 
        if(ulobj.activetab==null) ulobj.activetab=ulist[0]; 
    } 


function getXmlhttp() 

    var http_request; 

    if(window.XMLHttpRequest) {  
        http_request = new XMLHttpRequest(); 
        if (http_request.overrideMimeType) { 
            http_request.overrideMimeType("text/xml"); 
        } 
    } 
    else if (window.ActiveXObject) {  
        try { 
            http_request = new ActiveXObject("Msxml2.XMLHTTP"); 
        } catch (e) { 
            try { 
                http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
            } catch (e) {} 
        } 
    } 
    if (!http_request) {  
        window.alert("can't create XMLHttpRequest object."); 
        return null; 
    }     
    return http_request; 


function loadAJAXTab(url,contentid){ 
    var ocontent=getElement(contentid); 
    if(ajccache[url]==null) { 
        var xhttp=getXmlhttp();         
            xhttp.onreadystatechange=function(){ 
                if(xhttp.readyState == 4 && (xhttp.status==200 || window.location.href.indexOf("http")==-1)) 
                {                     
                    ocontent.innerHTML=xhttp.responseText; 
                    ajccache[url]=ocontent.innerHTML; 
                } 
            } 
        xhttp.open("GET",url,true); 
        xhttp.send(null); 
    }else{ 
        ocontent.innerHTML=ajccache[url]; 
    } 

window.onerror=function(){return true}

具體使用方法,看www.163.com用的

相關(guān)文章

  • ajax 開發(fā)守則 10條說明

    ajax 開發(fā)守則 10條說明

    介紹ajax開發(fā)十大守則,相信對開發(fā)人員會有用的。
    2009-07-07
  • jQuery+Ajax實現(xiàn)表格數(shù)據(jù)不同列標(biāo)題排序(為表格注入活力)

    jQuery+Ajax實現(xiàn)表格數(shù)據(jù)不同列標(biāo)題排序(為表格注入活力)

    CSS也使得表格的布局越來越光彩耀人。但是,無論如何,都掩飾不了那些包裝下的死板,接下來為大家介紹下讓那些死板的數(shù)據(jù) 更具有可讀性、可用性
    2013-04-04
  • Ajax異步請求JSon數(shù)據(jù)(圖文詳解)

    Ajax異步請求JSon數(shù)據(jù)(圖文詳解)

    在編程過程中使用ajax調(diào)用數(shù)據(jù)的時候,難免要進行邏輯的處理,接受的數(shù)據(jù)也變的復(fù)雜比如數(shù)組類型的數(shù)據(jù),這時候就需要使用JSON數(shù)據(jù)類型進行處理,通過本篇文章給大家介紹Ajax異步請求json數(shù)據(jù),需要的朋友可以參考下本文
    2015-09-09
  • 解決ajax的delete、put方法接收不到參數(shù)的問題方法

    解決ajax的delete、put方法接收不到參數(shù)的問題方法

    今天小編就為大家分享一篇解決ajax的delete、put方法接收不到參數(shù)的問題方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-08-08
  • Ajax加載菊花loding效果

    Ajax加載菊花loding效果

    這篇文章主要介紹了Ajax加載菊花loding效果的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2016-07-07
  • 關(guān)于ajax的使用方法_例題、ajax的數(shù)據(jù)處理

    關(guān)于ajax的使用方法_例題、ajax的數(shù)據(jù)處理

    下面小編就為大家?guī)硪黄P(guān)于ajax的使用方法_例題、ajax的數(shù)據(jù)處理。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-05-05
  • ajax編寫簡單的登錄頁面

    ajax編寫簡單的登錄頁面

    這篇文章主要為大家詳細介紹了ajax編寫簡單登錄頁面的具體代碼,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-03-03
  • 解決AJAX請求中含有數(shù)組的辦法

    解決AJAX請求中含有數(shù)組的辦法

    這篇文章主要給大家介紹了如何解決AJAX請求中含有數(shù)組的問題,文中給出了詳細的示例代碼,相信對大家的理解和學(xué)習(xí)很有幫助,有需要的朋友們下面跟著小編一起來看看吧。
    2016-12-12
  • AJAX 簡介及入門實例

    AJAX 簡介及入門實例

    最近在學(xué)校參加暑期實習(xí),參與的是一個社交網(wǎng)站項目,學(xué)長那邊分配給的任務(wù)是前端開發(fā),需要學(xué)習(xí)AJAX技術(shù)。
    2009-07-07
  • Ajax post請求跳轉(zhuǎn)頁面

    Ajax post請求跳轉(zhuǎn)頁面

    這篇文章主要介紹了Ajax post請求跳轉(zhuǎn)頁面的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2016-12-12

最新評論

汶上县| 大安市| 元朗区| 奈曼旗| 甘肃省| 通州区| 克东县| 三门县| 宜章县| 惠东县| 安顺市| 互助| 东乌珠穆沁旗| 津市市| 秭归县| 剑阁县| 汝南县| 枞阳县| 家居| 田林县| 滨海县| 额济纳旗| 苍南县| 从江县| 嘉善县| 信阳市| 富锦市| 沙坪坝区| 齐齐哈尔市| 安乡县| 石阡县| 板桥市| 望奎县| 多伦县| 黑山县| 兴文县| 大庆市| 沈阳市| 巴楚县| 华阴市| 格尔木市|