接受按键

按A就会跳转到娃娃亲的网页,请按A
<SCRIPT language="JavaScript">
<!--
var hotkey=97
var destination="http://www.XXX.com"
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e){
if (document.layers){
if (e.which==hotkey)
window.location=destination
}
else if (document.all){
if (event.keyCode==hotkey)
window.location=destination
}
}
document.onkeypress=backhome
onkeydown="javascript:onenter();"
function onenter(){
 if(event.keyCode==13){
alert("回车");
}
}
</SCRIPT>
posted @ 2008-07-27 04:14  fool  阅读(156)  评论(0编辑  收藏  举报