您的位置:首页 > 其它

快速与任意QQ号码建立临时对话

2008-10-10 22:37 351 查看
那时候在群里讨论的,吸纳很多人的方法与意见,修改而成的

<html>

<body onload="window_onload()" onkeydown="document_onkeyup()">

<script>

function locate(){

var input= document.getElementById("no").value;

document.getElementById("no").focus();

var reg = /^[1-9]/d{4,9}$/;

if(!reg.test(input)){

alert("非法的QQ号码");

document.getElementById("no").select();

return;

}

document.getElementById("ifrHtmlEditor").src = "http://wpa.qq.com/msgrd?

V=1Uin="+input+"Site=www.qq.comMenu=yes";

document.getElementById("no").select();

}

function document_onkeyup() {

if (event.keyCode==13)

locate();

if (event.keyCode==8)

return;

if( (event.keyCode >= 47 && event.keyCode <= 57) || (event.keyCode >= 0x60 && event.keyCode <= 0x69) )

event.returnValue = true;

else

event.returnValue =false;

}

function window_onload()

{

document.getElementById("no").focus();

}

</script>

<input type="text" id="no"/><input type="button" onclick="locate()" value="聊天"/>

<iframe src="about:blank" id="ifrHtmlEditor" name="ifrHtmlEditor" style="display:none"></iframe>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: