I have an error code in the latest version of jQuery v3.1.1 In version 1 there is no error. Here is the code:
//IMAGE ERROR
$('img').error(function () {
var s, w, h;
s = $(this).attr('src');
w = s.split('&')[1].replace('w=', '');
h = s.split('&')[2].replace('h=', '');
$(this).attr('src', '../tim.php?src=admin/_img/no_image.jpg&w=' + w + "&h=" + h);
});
Error documentation: documentation here