| 在网页中加入热键 |
<SCRIPT language="JavaScript">
<!--
var hotkey=98
var destination="http://www.lanyug.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>
|
| 效果:按一下“B”键 |
|