JavaScript - tough nut !?
Challenge: I want to extend certain DOM-elements with some JS-logic.
Sounds simple, but becomes tough if some other page components may change the DOM, e.g. by fetching additional elements via Ajax.
Any Hints how to acchieve this?
Sounds simple, but becomes tough if some other page components may change the DOM, e.g. by fetching additional elements via Ajax.
$$(".task-delete").each(function(item) {
item.onclick = ...
});
So the above code needs to be called after the page has been loaded, but also needs to be called whenever the DOM changes (ie when a new element is inserted via Ajax for example). Any Hints how to acchieve this?
michi - 20.Jul 2007 10:27 - technisches