views:

28

answers:

0

Hi, I would like to execute a function when new dom elements are added via ajax, somewhere in the body, by a 3er party JS.

The function i want to execute is jqueryui's tooltip(), which changes title attribute into nice tooltips.

The problem happens when a 3rd party JS adds new elements to many differents div's, and the new element's 'title' attribute are not being substituted by tooltips. So I need to do again:

$('*').tooltip()

I think I need something checking if new elements have been added to the body, and run the function on them.

Any ideas ?