国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > 建站經(jīng)驗(yàn) > 正文

網(wǎng)站商務(wù)通openZoosUrl函數(shù)詳解

2024-04-25 20:47:25
字體:
供稿:網(wǎng)友

前面的文章中已經(jīng)為大家介紹了 商務(wù)通核心函數(shù)庫解密格式化后的代碼 ,那么今天就帶大家詳細(xì)的分析一下商務(wù)通中使用頻率最高的一個(gè)函數(shù)openZoosUrl,openZoosUrl函數(shù)的作用是打開商務(wù)通對(duì)話窗口。openZoosUrl函數(shù)完整代碼如下,我們可以發(fā)現(xiàn)其包含兩個(gè)參數(shù)url和data。我們通常在網(wǎng)站中這樣使用openZoosUrl函數(shù):

<a href="javascript:;" onclick="openZoosUrl();">點(diǎn)擊咨詢</a>

或者

<a href="javascript:;" onclick="openZoosUrl('chatwin','&e=banner');">點(diǎn)擊咨詢</a>

通過分析openZoosUrl的代碼,我們可以發(fā)現(xiàn)代碼中是對(duì)參數(shù)和一些變量的判斷,然后拼接出一個(gè)對(duì)話窗口的鏈接,其中包含一些商務(wù)通信息,如訪客的唯一ID,來路url以及說明信息,相信具有一定JS基礎(chǔ)的朋友都能夠看懂。

 

復(fù)制代碼代碼如下:
function openZoosUrl(url, data) {
    if (typeof(openZoosUrl_UserDefine) == 'function') {
        if (openZoosUrl_UserDefine()) return
    };
    if (typeof(LR_istate) != 'undefined') {
        LR_istate = 3
    }
    var lr_url1 = url;
    if (typeof(LR_opentimeout) != 'undefined' && typeof(LR_next_invite_seconds) != 'undefined') LR_next_invite_seconds = 999999;
    if (url == 'sendnote') {
        url = LR_sysurl + 'LR/Chatwin2.aspx?siteid=' + LR_websiteid + '&cid=' + LR_cid + '&sid=' + LR_sid + '&lng=' + LR_lng + '&p=' + escape(location.href) + lr_refer5238()
    } else {
        url = ((LR_userurl0 && typeof(LR_userurl) != 'undefined') ? LR_userurl: (LR_sysurl + 'LR/Chatpre.aspx')) + '?id=' + LR_websiteid + '&cid=' + LR_cid + '&lng=' + LR_lng + '&sid=' + LR_sid + '&p=' + escape(location.href) + lr_refer5238()
    }
    if (typeof(LR_UserSSL) != 'undefined' && LR_UserSSL && url.charAt(4) == ':') url = url.substring(0, 4) + 's' + url.substring(4, url.length);
    if (!data) {
        if (typeof(LR_explain) != 'undefined' && LR_explain != '') {
            url += '&e=' + escape(escape(LR_explain))
        } else if (typeof(LiveAutoInvite1) != 'undefined') {
            url += '&e=' + escape(escape(LiveAutoInvite1))
        }
    }
    if (typeof(LR_username) != 'undefined') {
        url += '&un=' + escape(LR_username)
    }
    if (typeof(LR_userdata) != 'undefined') {
        url += '&ud=' + escape(LR_userdata)
    }
    if (typeof(LR_ucd) != 'undefined') {
        url += '&ucd=' + escape(LR_ucd)
    }
    if (data) url += data;
    url += '&d=' + new Date().getTime();
    if (lr_url1 == 'fchatwin') {
        LR_ClientEnd = 0;
        window.location = url + '&f=1';
        return
    }
    var oWindow;
    try {
        if (LR_isMobile) {
            window.location = url
        } else if (LR_checkagent('opera|safari|se 2.x')) {
            oWindow = window.open(url)
        } else {
            oWindow = window.open(url, 'LRWIN_' + LR_websiteid, 'toolbar=no,width=630,height=435,resizable=yes,location=no,scrollbars=no,left=' + ((screen.width - 630) / 4) + ',top=' + ((screen.height - 435) / 4))
        }
        if (oWindow == null) {
            LR_ClientEnd = 0;
            window.location = url;
            return
        }
        oWindow.focus()
    } catch(e) {
        if (oWindow == null) {
            LR_ClientEnd = 0;
            window.location = url
        }
    }
}

 


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到建站經(jīng)驗(yàn)頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 清远市| 修水县| 静海县| 突泉县| 高阳县| 岑巩县| 石城县| 奉新县| 天峨县| 肇庆市| 贡觉县| 年辖:市辖区| 内乡县| 雅江县| 义乌市| 嘉禾县| 定结县| 改则县| 米林县| 黔江区| 水城县| 栾城县| 濮阳县| 乌兰县| 仁布县| 乌审旗| 临桂县| 固安县| 琼海市| 伊宁县| 高淳县| 湘乡市| 横山县| 介休市| 黑山县| 黑河市| 巴塘县| 固阳县| 通州区| 英德市| 疏附县|