For images and frames, you can use the event load:
var $elems = $('#div').find('img, iframe');
var elemsCount = $elems.length;
var loadedCount = 0;
$elems.on('load', function () {
loadedCount++;
if (loadedCount == elemsCount) {
alert('elements loaded successfully');
}
});
You must execute the above script after adding your elements via Ajax to your element #div.
source
share