Page 1 of 1

Event aliasing?

Posted: Thu Apr 14, 2005 11:43 am
by Chris Corbyn
Can I make an alias for a given (JavaScript) event?

Such as...

make onMouseover have the alias onMO... so I could do

Code: Select all

<span id=&quote;doodah&quote; onMO=&quote;doThis()&quote;>....
I'm considering implementing something into an app I'm working on which would have hundreds of event handlers in the tags so this could trim the code down a bit....

Thanks :-)

Maybe n00b knows ?

Posted: Thu Apr 14, 2005 3:39 pm
by feyd
no.

However, you can use Javascript to walk the document/object-tree setting the appropriate event handlers for each element based on their name, type, id, etc...

Posted: Thu Apr 14, 2005 4:52 pm
by Chris Corbyn
feyd wrote:no.

However, you can use Javascript to walk the document/object-tree setting the appropriate event handlers for each element based on their name, type, id, etc...
Yeah that's a good plan.

I'll just give em different ID's and try that idea :-)

Thanks!