Mercurial > hg > index.fcgi > www > www-1
comparison pics/np_keys.js @ 141:df18c9d8857c
myrss2: FEEDS: Add theconversation.com, remove Coding Horror
author | paulo |
---|---|
date | Sun, 06 Aug 2023 17:34:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2a641a6c8714 |
---|---|
1 function getKeypress(e) { | |
2 c = null | |
3 | |
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 | |
8 | |
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 } | |
18 | |
19 function goHref(id) { | |
20 window.location.href = document.getElementById(id).href; | |
21 } | |
22 | |
23 document.onkeypress = getKeypress |