<div class="content">Some original Text<img src="someImage"></div>
$.ajax('someAjaxUrl', function(data){
$('content').html(data);
})
I'm using some codes similar to above to get content from server and display it in the content area. The actual content contains lots of images and text, so after the ajax request is completed and the HTML has been changed, it still takes some time to render all the images. I'm trying to catch the event when all the new contents have been fully loaded including the images:
$.ajax('someAjaxUrl', function(data){
$('content').html(data);
$('content')[0].addEventListener('load',function(){
// Do something
})
})
But this seems not working. Is this possible?