给页面加热键

时间:2007-04-13 来源:互联网 编辑:司徒白 作者:不详 [ ]
  给页面加热键
以下是代码片段:

<HTML>
<HEAD>
<TITLE>给页面加热键</TITLE>

</HEAD>

<BODY>
按"a"键试试
<SCRIPT language="JavaScript">
<!--
var hotkey=97
var destination="http://www.itzcn.net";
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function Helpor_net(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination;
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination;
}
}
document.onkeypress=Helpor_net;
//-->


</SCRIPT>
</BODY>
</HTML>

 


访问() 相关评论() 打印资源 返回顶部 加入收藏

最新评论