I have following ajax call:
$("#container").html("loading...");
$.ajax({
url: "somedoc.php",
type: "POST",
dataType: "html",
success: function(response){
if(response != ''){
$("#container").html(response);
}
}
});
Response look like this:
<ul>
<li><img src="big_size_image_1.jpg" alt="" /></li>
<li><img src="big_size_image_2.jpg" alt="" /></li>
<li><img src="big_size_image_3.jpg" alt="" /></li>
</ul>
Ajax call finishes up before all images are downloaded to the user. So
is it possible to use load function here and show loading text while
not all images are loaded ?
Your help would be appreaciated.
You could attach a load event to the images, see if this works for you: