In some event of my script, I execute:
$('#myDiv').load('externalelem.php');
But, as we all know, the new elements will not be affected by functions executed on page complete. Like:
$(document).ready(function() {
$('.ttip').tooltip();
}
These new injected elements will not have tooltips. I have tried to:
- call tooltip() after load()
- call tooltip() inside “externalelem.php’
None have worked. There are plenty of scripts that are affected by this issue. How can I fix it?
Just recall your tootip function after the new elements have been added to the
DOM:You can read more about using the optional callback handler here: http://api.jquery.com/load-event/