You're doing that wrong, right now you're trying to load data with ajax from the URL img
, as that's what the load()
method does, and that's why you're getting the 404.
Using a delegated event handler like that makes no sense, if you're trying to wait for all external resources (as in images etc.) to load, use window.onload
$(window).on('load', function(){
alert('images have loaded');
});