使用js代码判断qq是否在线。
例子:
<script type="text/javascript">
var img_zx="zx.gif",img_xx="xx.gif";
var online = new Array();
var qqGame=new Array("78239707|黄老师","285506988|黄老师");
var query="";
for(var i=0;i<qqGame.length;i++)
{
query+=qqGame[i].split("|")[0]+":";
}
document.write("<script language=javascript src="http://webpresence.qq.com/getonline?Type=1&"+query+""></script>");
</script>
<script type="text/javascript">
function getImg()
{
var url,qqname,s,qq;
for(var i=0;i<qqGame.length;i++)
{
if (online[i])
url=img_zx;
else
url=img_xx;
qq=qqGame[i].split("|");
qqname=qq[0]+qq[1];
s="<img src='"+url+"'><a href='http://wpa.qq.com/msgrd?V=1&Uin="+qq[0]+"&Site="+qq[1]+"&Menu=yes' target='_blank'>"+qqname+"</a>"
document.write(s);
}
}
getImg();
</script>