I'd like to switch any broken images in dynamically loaded HTML to a warning graphic, something like:
- $(function() {
$('#alwayshere').on('error','img',function() {
$(this).prop('src','/img/404.png');
});
$('#alwayshere').append('<img src="/img/asdf.png" />');
});
This works with with the 'click' event but not with 'error' or 'load' ... is there another way to do it? I remember with .live() there were restrictions on what events could be bound, but I can't find that in the documentation anymore for jQuery 1.7's .on()
Thanks in advance for any tips,
-Wick
--
http://www.CarComplaints.com