192、热键驱动链接

192、热键驱动链接

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

var key = new Array();  // Define key launcher pages here

key['h'] = "http://www.7stk.com/index.htm";

key['f'] = "http://www.7stk.com";

key['n'] = "http://javacool.3322.net";

key['s'] = "http://www.7stk.com";

 

function getKey(keyStroke) {

isNetscape=(document.layers);

// Cross-browser key capture routine couresty

// of Randy Bennett (rbennett@thezone.net)

eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;

which = String.fromCharCode(eventChooser).toLowerCase();

for (var i in key) if (which == i) window.location = key[i];

}

document.onkeypress = getKey;

//  End -->

</script>

</HEAD>

<table border=0><tr><td>

<pre>

'h' 去本站首页

'f' 去网络时空

'n' javacool

's' 去南京有线视台

</pre>

</td></tr></table>

Write a comment

Comments: 0