I have some code I am trying to run once my image has finished loading. I use this following jQuery code:
$("#myimageid").load(function() {
alert('Image Loaded');
});
However the popup never show up. I can’t get the .load() function to work ! Anyone had issues with this?
If you’re running this after the image already has a set source, you need to do an additional check for caches images (who fired the event, just before you added an event handler listening for it). You can do that like this:
Update for later versions of query, use:
Using
(this).load();will produce aCannot read property 'indexOf' of undefinederror