Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
jQuery plugin to detect and replace broken or slow-loading images
branch: master
Failed to load latest commit information.
README.markdown Remove reference to Github pages URL and update copyright date
bower.json Add bower.js
jquery.brokenimage.js Add jQuery plugins manifest and version bump to 1.0.0
test.html Migrate to Google AJAX Libraries API (see http://blog…


brokenImage: a jQuery plugin

brokenImage is a jQuery plugin that is able to detect and replace images that are either broken or are taking a long time to load. If no replacement image is specified then the CSS visibility is set to hidden.


Fix a broken Image object:

  var image = new Image();
  image.src = '/might/be/broken.png';

Fix a broken image tag:

  <img src="/might/be/broken.png" alt="Might be broken" id="myImage" />


Fix a collection of images:

  <div id="myImages">
    <img src="/might/be/broken" alt="Might be broken" />
    <img src="/might/also/be/broken" alt="Might also be broken" />

  $('#myImages img').brokenImage();

Set a custom image replacement instead of setting the visibility to hidden:

  image.brokenImage({replacement: '/images/placeholder.png'});

Set a custom timeout to override the 5 second default:

  image.brokenImage({timeout: 100}); // 100 ms


Licensed under the MIT:

Copyright (c) 2011 Stateless Systems (

Something went wrong with that request. Please try again.