Benefit from the bubbling technique: Include the corresponding behavior for each context menu can improve the website functionality without worry about the listeners for each element with a context menu attached:
Click on the icon to get the RSS FEED
Example link: Click here to Bookmark the YUI - Yahoo! User Interface
Click on the icon to Bookmark this this page
Button link:
The most common technique for apply context menus to the large number of links is the use of "getElementByTagName", processing each tag and creating one instance of the context menu object attached to each tag. This pre-processing can freeze your browser, and create memory leaks when you are using dynamic areas. With the bubbling technique we can guarantee the success without worry about dynamic areas. Also we don´t need to refer a link directly using the tabName or an unique ID to create the corresponding context menu object, decreasing the count of links with ID included inside the XHTML code.
This implementation has only two instance of the context menu object (Feed Context Menu and Bookmark Content Menu) for the document, decreasing the memory usage and rendering in realtime each "click" or "right click" event.