jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes Event parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Event parameter" Watch "Event parameter" New topic

Event parameter

Sen George
Ranch Hand

Joined: Sep 21, 2005
Posts: 76
The following code works but with one error. Error is that the argument "ev" is undefined. Please advise.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

IE does not follow the W3C standards for event handling. It makes the Event instance available at window.event instead of passing it to the listener.

So you could add code to the listener such as:to deal with this egregious behavior.

Also be aware that IE also populates the Event instance with non-standard properties. So you need to deal with that too!

Or (highly recommended!) use a library like jQuery for your event handling which hides these (and other) browser differences.

P.S. "ev"? What's wrong with "event"? Much more readable.
[ November 02, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Sen George
Ranch Hand

Joined: Sep 21, 2005
Posts: 76
Thank you for the clarification.
I agree. Here's the link: http://aspose.com/file-tools
subject: Event parameter
It's not a secret anymore!