Tuesday, March 22, 2005

A global event...in Firefox?

This is kind of nice:

function someHandler(a,x,y){
    alert(a.type);
}

<a href="#"
   onclick="someHandler(event,'x','y'); return false;">
   Do it</a>

Apparently, Firefox does support a global event object when passed as a parameter to an event handler, so the above code works in both Firefox and IE on Windows. You can't call window.event inside the function though, else Firefox will complain.

I've been doing the check for e for so long (see the previous post), like, waaaaay back in my DynAPI v1.0 days, that I hadn't noticed this technique was available.

5 Comments:

At 8:35 PM, Blogger AM said...

nice blog!!


http://bandwidtht1.com

 
At 9:35 AM, Blogger Mister Z said...

intresting... i have a friend that have fixed the firefox to do everything you want... its really great.

 
At 11:20 AM, Blogger MattRockin said...

University of Phoenix

 
At 5:48 AM, Blogger HiiFii Webservices said...

I liked you Blog so much,so i also wanted to show you some good resourses on the net.
Learn to earn 90000$/Month
For which you may also see my Personal Website
Here.
and for a Personal Education Career Tools
free Study Database.
This site is for seeing the
Hifi Electronics.
And this is for
World Class Gadgets

 
At 12:14 PM, Blogger conejoxxx said...

You just saved my life recently with this last post.
I don't know how you do it, people; but keep on doing it. I'll bookmark this blog and spread the word. Definetly.

www.ludo.com.uy

 

Post a Comment

<< Home