手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >接收键盘指令的脚本
接收键盘指令的脚本
摘要:按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中String.match()方法的使用详解

如何控制框架页的滚动

会自动逐行上升的文本框

JS获取时间的相关函数及时间戳与时间日期之间的转换

JavaScript中停止执行setInterval和setTimeout事件的方法

日历-指定日期的新闻

禁止按回车键提交表单的方法

一个表格收缩展开的函数

编写高质量JavaScript代码的基本要点

精品推荐
分类导航