Posted in Jquery

Fix Broken Images with jQuery Broken Image Fixer

Fix Broken Images with jQuery Broken Image Fixer Posted on January 22, 20152 Comments

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

Fix borken image jQuery
Best WordPress Hosting

If you usually add images from third-party websites via direct links, you may face the broken image problems. Suppose that website removed the image. Now, it will show broken image on your website. Broken images look dirty and also affect the look and feel of your website. It is also not good for the user experience of your website. So, there should be a solution for this. You can use jQuery to fix broken images and show a message container in place of broken image.

Process is simple. You need to find all image elements on the page and check if the image is valid. If the image is invalid, you can replace that image with a default placeholder image.

See the jQuery code below:

jQuery Broken Image Fixer
See this snapshot. In place of broken image, it is showing broken image container. You can use the above code in your website. Just put the above code in the footer of your website.

Advertisement

You can change the broken image container image in the code above. Use any image which you want to show in place of broken image.

Source

advertisement

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

2 thoughts on “Fix Broken Images with jQuery Broken Image Fixer

  1. This is awesome. I faced the broken image issue when I moved my website from blogger to WordPress but accidentally deleted the album from Google account. Using this is better than showing broken images to visitors.

    Thanks for this awesome article.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!