javascript - How Does One Attach A Handler To A Link Which Is Dynamically Loaded? -


How do I add a handler in the event of a link click, which is loaded dynamically i.e. Another action on the page loaded in response?

NB I'm asking how this prototype is using the Javascript library, but is not unfavorable for additional instances in JQuery.

In the code given below, the link is within the page section that is loaded dynamically: ' $ '('. Alist '). ('Inspection', 'click', function (event) {var clickedItem = event.findElement ('a')) Var href = clickedItem.readAttribute ('href'); New Ajax Updater ('extension', href, {method: 'get'})}} event.stop ();}); Use: .live ()

Prototype:


Comments