Skip to content

Commit

Permalink
added a check for attachEvent for older browsers that do not have add…
Browse files Browse the repository at this point in the history
…EventListener
  • Loading branch information
shoxty authored and jish committed Mar 1, 2012
1 parent 09bf315 commit de3139c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contra.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
Contra.initialize = function() {
if (document.addEventListener) {
document.addEventListener('keyup', Contra.check);
}
} else if(document.attachEvent) {
document.attachEvent('onkeypress', Contra.check);
}
}

Contra.addHandler = function(handler) {
Expand Down

0 comments on commit de3139c

Please sign in to comment.