Chequear si una imagen fue cargada


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var imgsrc = 'img/image1.png';
  2. $('<img/>').load(function () {
  3. alert('La imagen se cargó');
  4. }).error(function () {
  5. alert('Error al cargar la imagen');
  6. }).attr('src', imgsrc);

Report this snippet


Comments


You need to login to view comments.