0

Possible Duplicate:
Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser

how can i take my javascript code and make it go to my support document?

key['/'] = "support.php";   

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) window.location = key[i];
}
document.onkeypress = getKey;
Community
  • 1
  • 1
David Morin
  • 485
  • 3
  • 5
  • 16
  • You should probably look at your window manager's system-wide shortcut keys to try to make `F1` do something different. – sarnold Jul 03 '12 at 23:52

1 Answers1

1

As you'll see in this similar question, it's nearly impossible to achieve the behavior you desire cross-browser. You should use a different keyboard shortcut instead.

Community
  • 1
  • 1
Lusitanian
  • 11,012
  • 1
  • 41
  • 38