有很多朋友问Zanpo在线客服的代码,貌似网上也找不到好用的,因此打算把他自己珍藏的代码拿出来给大家分性享一下,很好用。
按钮部分,我是用图片来做例子
<SPAN style="CURSOR: hand"
onclick="javascript:addMSN('u148.net@hotmail.com');"><IMG
src="kefu.gif" border=0> </SPAN>
<DIV style="DISPLAY: none">
<OBJECT id=MsgrUIA height=0 codeType=application/x-oleobject width=0
classid=clsid:B69003B3-C55E-4b48-836C-BC5946FC3B28></OBJECT></DIV>
代码:
<A title="请确保XP版本以上的Windows并安装好MSN,或者手动添加地址。" href="msnim:chat?contact=u148.net@hotmail.com" target="_blank">给有意思吧发消息</A>
JS部分
<SCRIPT language=javascript>
<!--
function addMSN (address) {
if (MsgrUIA.MyStatus == 1)
{
alert('您的MSN没有登陆,请先登陆');
}
else if(MsgrUIA.MyStatus == 2 || MsgrUIA.MyStatus == 10 || MsgrUIA.MyStatus == 14 || MsgrUIA.MyStatus == 34 || MsgrUIA.MyStatus == 50 || MsgrUIA.MyStatus == 66 || MsgrUIA.MyStatus == 6) { //2,10, 14, 34, 50,66,6
MsgrUIA.InstantMessage(address);
}
else if (MsgrUIA.MyStatus == 512 || MsgrUIA.MyStatus == 768)
{
alert('您的MSN正在登陆,请稍等');
}
else {
alert('错误代码:'+ MsgrUIA.MyStatus + '。您没有安装MSN或使用的不是IE浏览器,请安装MSN并手动添加' + address );
}
}
-->
</SCRIPT>
ENGLISH
<SCRIPT language=javascript>
<!--
function addMSN (address) {
if (MsgrUIA.MyStatus == 1)
{
alert('Add a people to MSN , only for IE and you must have installed MSN or Window Message');
}
else if(MsgrUIA.MyStatus == 2 || MsgrUIA.MyStatus == 10 || MsgrUIA.MyStatus == 14 || MsgrUIA.MyStatus == 34 || MsgrUIA.MyStatus == 50 || MsgrUIA.MyStatus == 66 || MsgrUIA.MyStatus == 6) { //2,10, 14, 34, 50,66,6
MsgrUIA.InstantMessage(address);
}
else if (MsgrUIA.MyStatus == 512 || MsgrUIA.MyStatus == 768)
{
alert('Logining Now,Please wait!');
}
else {
alert('Error:'+ MsgrUIA.MyStatus + '。Send a message through MSN , only for IE and you must have installed MSN or Window Message' + address );
}
}
-->
</SCRIPT>
2007年11月8日更新,上面的代码已经不支持msn8.0 以下是更新后的代码



俺先收下了!