Wednesday, March 23, 2011

Firefox vs Chrome - Event variable names

Works in chrome, not firefox:

<button onclick="Foobar(evt);">

In order for firefox to work as well, the event variable MUST be named 'event'.

<button onclick="Foobar(event);>

I'm guessing webkit assumes the first arg is for the event data, and firefox probably matches the string with 'event'.


No big deal, using the word 'event' is probably a better style guide anyway.

No comments:

Post a Comment