Javascript examples for jQuery Method and Property:attr
Fire event if image is finished loading
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(function(){//ww w . java 2 s.c om $('#myimage').attr('src', 'http://www.java2s.com/style/demo/Firefox.png').load(function() { console.log('loaded!'); });; }); </script> </head> <body> <img id="myimage" src="http://www.java2s.com/style/demo/Firefox.png"> </body> </html>