Javascript: Know when an img is fully loaded

Posted by Paul Tarjan on Stack Overflow See other posts from Stack Overflow or by Paul Tarjan
Published on 2009-08-10T21:44:50Z Indexed on 2010/04/12 13:13 UTC
Read the original article Hit count: 475

Filed under:
|
|
|

If I have a beacon :

<img src="http://example.com/beacon" />

I want a method to be called once the beacon request finishes. Something like :

<script>
    $("img.beacon").load(function() {
        // do stuff knowing the beacon is done
    });
</script>

Is it possible? Is it in JQuery?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery