Hello. I've written this code inside the HEAD tags of my HTML page. It works fine in FF, Chrome and Safaria, but doesn't in IE7. I would like to know how to fix it.
<script type="text/javascript">
if ( window.addEventListener ) {
window.addEventListener("keydown", function(e) {
alert(e.keyCode);
}, true);
}
</script>
Thanks in advance.