Posted by Andy Dingley on 07/24/06 16:30
Chris Tomlinson wrote:
> We have about 30 images on a page, and want to apply something like this to
> all of them:
>
> < ... oncontextmenu="alert('Message here.');return false;" title="Another
> message here." ... >
Use subroutines, not pages of inline code.
Write subroutines that are context-intelligent, i.e. they can tell
which event and DOM node triggered them and react accordingly, they
don't have to have a squillion parameters passed in through the inline
event handler call.
Use event listeners.
Read any modern book on modern JavaScript techniques (probably one
blathering about AJAX too)
[Back to original message]
|