views:

114

answers:

2

I have recently started learning unobtrusive JavaScript. Using JQuery its really fun.

However with this thinking of writing JavaScript code has come a real long way from traditional ways. Also adding quick onclick="fun()" is helpful sometimes and as the application grows 100% unobtrusive code "sometimes" become difficult to write. Like attaching multiple events to one DOM element and thinking which one will get executed ?

So i would like to know points that should be watched while writing unobtrusive JavaScript code to keep life easy.

Thanks,

+4  A: 

Regarding DOM elements listening to multiple events, I find something like visual event really helpful:

http://www.sprymedia.co.uk/article/Visual+Event

Some frameworks have methods for logging event listeners, but it's most often forgotten.

David
A: 

You should also check out Inline Code Finder, an extension for firebug.

Rajat