javascript Discuz代碼中的msn聊天小功能
更新時(shí)間:2008年05月25日 20:10:37 作者:
參考discuz的msn聊天功能代碼
javascript中添加以下2個(gè)函數(shù)
function msnoperate(action, msn) {
var actionArray = new Array();
actionArray = {
'add' : 'http://go.discuz.com/?app=msn&linkid=5&msn=' + msn,
'chat' : 'http://go.discuz.com/?app=msn&linkid=6&msn=' + msn
}
if(messengerInstalled()) {
window.open(actionArray[action]);
} else {
window.open('http://go.discuz.com/msn/msn.html','_blank','width=571, height=498');
}
}
function messengerInstalled() {
try {
new ActiveXObject("MSNMessenger.P4QuickLaunch");
return true;
}
catch (e) {
return false;
}
}
html代碼中添加以下內(nèi)容:
———————————–
點(diǎn)擊圖標(biāo)與我聊天吧! <a href=”#” onclick=”msnoperate('add', ‘xxx@hotmail.com')”><img src=”/images/msnadd.gif” border=”0″ alt=”添加xxx為MSN好友”></a>
<a href=”#” onclick=”msnoperate('chat', ‘xxx@hotmail.com')”><img src=”/images/msnchat.gif” border=”0″ alt=”通過MSN和xxx聊天”></a>
<a href=”http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=綠茶館兒~|WWW.GETO.CN&Menu=yes” target=”_blank”><img src=”http://wpa.qq.com/pa?p=1:123456789:4“ border=”0″ alt=”QQ” /></a>
function msnoperate(action, msn) {
var actionArray = new Array();
actionArray = {
'add' : 'http://go.discuz.com/?app=msn&linkid=5&msn=' + msn,
'chat' : 'http://go.discuz.com/?app=msn&linkid=6&msn=' + msn
}
if(messengerInstalled()) {
window.open(actionArray[action]);
} else {
window.open('http://go.discuz.com/msn/msn.html','_blank','width=571, height=498');
}
}
function messengerInstalled() {
try {
new ActiveXObject("MSNMessenger.P4QuickLaunch");
return true;
}
catch (e) {
return false;
}
}
html代碼中添加以下內(nèi)容:
———————————–
點(diǎn)擊圖標(biāo)與我聊天吧! <a href=”#” onclick=”msnoperate('add', ‘xxx@hotmail.com')”><img src=”/images/msnadd.gif” border=”0″ alt=”添加xxx為MSN好友”></a>
<a href=”#” onclick=”msnoperate('chat', ‘xxx@hotmail.com')”><img src=”/images/msnchat.gif” border=”0″ alt=”通過MSN和xxx聊天”></a>
<a href=”http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=綠茶館兒~|WWW.GETO.CN&Menu=yes” target=”_blank”><img src=”http://wpa.qq.com/pa?p=1:123456789:4“ border=”0″ alt=”QQ” /></a>
相關(guān)文章
Javascript實(shí)現(xiàn)圖片輪播效果(一)讓圖片跳動(dòng)起來
圖片輪播效果,在各大網(wǎng)站的首頁都能看到,比較常見,下面腳本之家小編給大家介紹Javascript實(shí)現(xiàn)圖片輪播效果(一)讓圖片跳動(dòng)起來,需要的朋友參考下2016-02-02
JS交互點(diǎn)擊WKWebView中的圖片實(shí)現(xiàn)預(yù)覽效果
這篇文章主要介紹了JS交互點(diǎn)擊WKWebView中的圖片實(shí)現(xiàn)預(yù)覽效果,需要的朋友可以參考下2018-01-01
淺談javascript函數(shù)劫持[轉(zhuǎn)自xfocus]
javascript函數(shù)劫持,也就是老外提到的javascript hijacking技術(shù)。最早還是和劍心同學(xué)討論問題時(shí)偶然看到的一段代碼2008-02-02
通過JAVAScript實(shí)現(xiàn)頁面自適應(yīng)
通過JAVAScript實(shí)現(xiàn)頁面自適應(yīng)...2007-01-01
JS實(shí)現(xiàn)簡(jiǎn)單的頂部定時(shí)關(guān)閉層效果
這篇文章主要介紹了通過JS實(shí)現(xiàn)的簡(jiǎn)單頂部定時(shí)關(guān)閉層效果,需要的朋友可以參考下2014-06-06
微信小程序點(diǎn)擊item使之滾動(dòng)到屏幕中間位置
這篇文章主要介紹了微信小程序點(diǎn)擊item使之滾動(dòng)到屏幕中間位置,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-03-03
使用mouse事件實(shí)現(xiàn)簡(jiǎn)單的鼠標(biāo)經(jīng)過特效
這篇文章主要介紹了使用mouse事件實(shí)現(xiàn)簡(jiǎn)單的鼠標(biāo)經(jīng)過特效的方法,需要的朋友可以參考下2015-01-01

