Event aliasing?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Event aliasing?

Post 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 ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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!
Post Reply