At the moment, I have a piece of code looking like this:
$("#somediv").append(data);
somethingToDoAfterDataAppended();
It seems that the data is appended asynchronously, therefor the next function is not necessarily invoked after data is actually appended.
I was thinking about a way to bind this function with 'data appended' event - is it possible?
Any other solution would be equally useful.