Digirunt
06-27-2003, 06:08 AM
Why doesn't this work with Netscape, it doesn't cause errors just does nothing?
var key = new Array();
key['0'] = "index.htm";
key['1'] = "poetry_index3.htm";
key['2'] = "art_index.htm";
key['3'] = "about_index.htm";
key['h'] = "help.htm";
function getKey(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key) if (which == i) top.location = key[i];
}
document.onkeypress = getKey;
In IE the pages jump fine but the keystrokes aren't captured at all in NS6
var key = new Array();
key['0'] = "index.htm";
key['1'] = "poetry_index3.htm";
key['2'] = "art_index.htm";
key['3'] = "about_index.htm";
key['h'] = "help.htm";
function getKey(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key) if (which == i) top.location = key[i];
}
document.onkeypress = getKey;
In IE the pages jump fine but the keystrokes aren't captured at all in NS6