title: event in firefox "e is undefined"
body: <p>I have a function that get the key code when pressed.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>function Getkeycode(e){
     var keycode = null;
     if (window.event) 
         keycode = window.event.keyCode;
     else 
         keycode = e.which;
     return keycode;
  }
  
  window.onkeydown = function(){
     alert(Getkeycode());  // I'm tried to using  Getkeycode() or Getkeycode(e) but still error
  }
  </code></pre>
  
  <p>Previous code works well in Internet Explorer, but in Firefox always occurs error message >> <code>e is undefined</code> or <code>e is not defined</code></p>