view pics2/np_keys.js @ 88:583400dc28a0

myrss: update user-agent string to "Mozilla/5.0 Browser" after some servers complain about "Mozilla/5.0"; show exception type in top-level exception handler log message
author paulo
date Thu, 12 Jan 2017 00:59:05 -0700
parents
children
line source
1 function getKeypress(e) {
2 c = null
4 if (e.which == null)
5 c = String.fromCharCode(e.keyCode); // IE
6 else if (e.which != 0 && e.charCode != 0)
7 c = String.fromCharCode(e.which); // All others
9 if (c != null) {
10 if (c == 'n')
11 goHref('next');
12 else if (c == 'p')
13 goHref('prev');
14 else if (c == 'u')
15 goHref('up');
16 }
17 }
19 function goHref(id) {
20 window.location.href = document.getElementById(id).href;
21 }
23 document.onkeypress = getKeypress