Hi everyone,

Like a lot of methods of jQuery, why the .html() doesnt have a
callback?

I need that some javascript load when the dom change with .html()
(append and others too), and some events are attached with the new
elements created by this method. What happens is that sometimes they
are attached and other times not. I thing its due the fact that I
execute this code:

$('#div').html(stuffVar);
$.getScript('newEvents.js');

This work sometimes. I would need one way to accomplish this task like
this:

$("#div').html(stuffVar,function(){
$.getScript('newEvents.js');
});

This way, we would have sure that the html is updated and so we can
load the script to attach events.

Anyone has idea???
thanks,

Alexandre Magno
Web Developer
http://blog.alexandremagno.net

Reply via email to