Deprecated: Assigning the return value of new by reference is deprecated in /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php on line 90

Deprecated: Assigning the return value of new by reference is deprecated in /home/techmasa/public_html/wp-content/plugins/sem-recent-posts.php on line 942
TechMasala - Technology Spice Rack » Javascript Event Order

Javascript Event Order

A typical problem that developers face is handling an event of same type, when the elements are nested and both of them implement the same event. Suppose you have an element (say element 2) inside another element (say element 1). Let’s say both element 1 and element 2 implement the onclick event. When the user clicks on element 2, since it is nested, should the onclick event of element 1 get triggered first and then of element 2 or vice versa? Since the elements are nested and using the same event both the element’s event handler methods are called. The question is which one first.

Here is a link to a blog article “Event Order” which explains the problem, and the solution to it. Thanks to my friend and colleague, Narayanan who sent me this link when we faced the problem handling such a situation while developing Jiffle.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Javascript Event Order at blinklist.com    Bookmark Javascript Event Order at blogmarks    Bookmark Javascript Event Order at del.icio.us    Digg Javascript Event Order at Digg.com    Fark Javascript Event Order at Fark.com    Bookmark Javascript Event Order at Furl.net    Bookmark Javascript Event Order at NewsVine    Bookmark Javascript Event Order at reddit.com    Bookmark Javascript Event Order at Simpy.com    Bookmark Javascript Event Order at Spurl.net    Bookmark Javascript Event Order with wists    Bookmark Javascript Event Order at YahooMyWeb

      Cosmos

Leave a Comment

authimage


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.