if (!window.console) { var stub = function() { }; window.console = { log: stub, error: stub, warn: stub }; } var keyHandler; $(document).bind('keydown', function(event) { console.log('cc: '+event.charCode+'/'+String.fromCharCode(event.keyCode).toLowerCase()+' kc: '+event.keyCode); if (keyHandler) keyHandler(String.fromCharCode(event.keyCode).toLowerCase(), event.keyCode); }); $(window).bind('load', function() { $('#game').hide(); $('#scoreboard').hide(); loadQuizData(function() { // Quiz data has initialized $('#setup').show(); $('#start').bind('click', function() { try { startQuiz(); } catch (e) { console.error(e.stack); } return false; // don't submit