Here's a script for hot-key jumps. A user presses the key specified below, and it takes them to the url you specify. The keys and urls are color-matched for clarity. Use any letter or letters you like. If you use less letters, remove the corresponding url. If you add letters, add the corresponding url. The hotkeys are CASE sensitive. This entire script goes into the HEAD section of your document.

<Script Language="JavaScript">
var aKeyArray = new Array('a','b','c','d','e','f');
var aLocationArray = new Array('http://www.URLforLetterA.com','http://www.URLforLetterB.com','http://www.URLforLetterC.com','http://www.URLforLetterD.com','http://www.URLforLetterE.com','http://www.URLforLetterF.com');

function doHotKey(e){
for(i=0; i < aKeyArray.length; i++){
if(document.layers){ // NN4+
if (aKeyArray[i] == String.fromCharCode(e.which)){
window.location = aLocationArray[i];
}
} else if(document.all){ // IE4+
if(aKeyArray[i] == String.fromCharCode(event.keyCode)){
window.location = aLocationArray[i];
}
} else if(document.getElementById){ // NN6
if(aKeyArray[i] == String.fromCharCode(e.which)){
window.location = aLocationArray[i];
            }
       }
   }
}


if(document.layers){
document.captureEvents(Event.KEYPRESS);
}
document.onkeypress=doHotKey;
</script>


Back

Press H for TWebMan Home | P for PerlScripts | M for MySQL | A or C for Autorepaircd.Com