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.

  $$(".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?

Search

 

About michi

michi Michi a.k.a. 'Michael Platzer' is one of the Knallgraus, a Vienna-based New Media Agency, that deals more and more with 'stuff' that is commonly termed as Social Software.

Meet my fellow bloggers at Planet Knallgrau.

my delicious

Recent Updates

My Gadgets

Credits

Knallgrau New Media Solutions - Web Agentur f�r neue Medien

powered by Antville powered by Helma


Creative Commons License

xml version of this page
xml version of this page (summary)

twoday.net AGB

Counter



berufliches
blogosphaerisches
privates
spassiges
sportliches
technisches
trauriges
Profil
Logout
Subscribe Weblog