Skip to content

Instantly share code, notes, and snippets.

@tevashov
Last active October 27, 2022 21:35
Show Gist options
  • Select an option

  • Save tevashov/5172460 to your computer and use it in GitHub Desktop.

Select an option

Save tevashov/5172460 to your computer and use it in GitHub Desktop.
Event if an image is loaded or not with #jQuery
var imgsrc = 'img/image1.png';
$('<img/>').load(function () {
alert('image loaded');
}).error(function () {
alert('error loading image');
}).attr('src', imgsrc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment