After user take action I get related images from server and show to user. I dynamically insert these images under html element (div). After all of the images are completely loaded I want to run some script. Here is my sample code:
var images = []; //array of image urls
$(document).on('someEvent', function(){
$.each(images, function(){
$('#imagesList').append('<li><img src="' + this + '" /></li>');
}); });
$('#imagesList').on('load', function(){ $(this).show(); });
The load event is not firing. Also, is the load event is right event if some images was cached previously and some was not?
I don't understand how my question can be related to How can I be notified when an element is added to the page? this post.
I need to run script after all dynamically added images are loaded within div element