Is there a callback for the html() function or a way to check that it is finished. For example:
$(\"#some_div\").html(\'something here\');
if($(\"#some_div\
Hopefully somebody has a better solution than myself. A quick workaround is to use setTimeout() to delay your next calls, giving your HTML block enough time to load (since the load time is so miniscule).
$('#some_div').html('some content');
// set timeout for 250 milliseconds
setTimeout(callbackFunction, 250);
function callbackFunction() {
// do some cool sh*t
}
Note, however, that if you wanted to pass any variables to your function, you could do the following:
$('#some_div').html('some content');
// set timeout for 250 milliseconds
var myParam = 'value';
setTimeout(function() { callbackFunction(myParam); }, 250);
function callbackFunction(myParam) {
// do some cool sh*t
alert(myParam);
}