How to make window.event in javascript in Firefox

Here am sharing the way how we get window.event in Firefox.
The general issue is we get proper object in IE Chrome, but we find issue in Fire fox.
So here is the way we need to handle for fire fox
just give "window.Event" instead of "window.event" for Firefox.( note that E is capital in event.)
Thats all it will work.

// sample code

e = e ? e : window.event; // this works fine in IE
// but in fire fox we need to explicitly give the event so the below code does it.

e = window.Event;

Hope this helps.



No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: