Commits

Luke Plant  committed fec1171

Get it working in Firefox, Opera, and Chrome

  • Participants
  • Parent commits 4432913

Comments (0)

Files changed (1)

     $('#id_prev').click(showPrevious);
     $('#id_next').click(showNext);
     $(document).bind('keypress', function(e) {
-        var n = e.charCode - 48;
-        var k = String.fromCharCode(e.charCode)
+        var cc = e.charCode === 0 || e.charCode === undefined ? e.keyCode : e.charCode;
+        var n = cc - 48;
+        var k = String.fromCharCode(cc)
         if (n > 0 && n < 6) {
             showAnswer(n);
         }