接收键盘指令的脚本_Javascript教程-查字典教程网
接收键盘指令的脚本
接收键盘指令的脚本
发布时间:2016-12-29 来源:查字典编辑
摘要:按A就会跳转到地图名片的网页,请按A

按A就会跳转到地图名片的网页,请按A

<SCRIPT language="JavaScript">

<!--

var hotkey=97

var destination="http://mc.mapabc.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>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Javascript教程学习
    热门Javascript教程学习
    编程开发子分类