September 5, 2020
Category : Javascript
jQuery
How to check image loaded or not in JQuery?
Sometimes we need to detect upto image load successfully, for example you want to do print text instead of image before load image. so you can do that using jquery load and error method. you can see bellow example:
Example:
<script type="text/javascript">
$('.image')
.load(function(){
console.log("Now loaded correctly");
})
.error(function(){
console.log("Found Error in loading image");
});
</script>

Hardik Savani
I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.