Jquery checks whether an image fails to be loaded.

Source: Internet
Author: User

).

JavaScript code:

$(function(){$(".phpernote_content img").each(function(){if(this.fileSize<=0){this.src="http://www.phpernote.com/images/load_fail.png";}});});

Some html code:

<Div class = "phpernote_content"> <div>  </div> <div class = "videoTitle"> php tutorial </div> <div class = "phpernote_content"> <div>  </div> <div class = "videoTitle"> javascript tutorial </div>
Articles you may be interested in
  • Js checks whether the image is loaded and obtains the image width.
  • Js determines whether the image has been loaded
  • JavaScript and Jquery dynamically load Js files and Css files
  • Jquery checks whether the page has been loaded with the jquery File
  • Image zoom-in display special effects slimbox the most lightweight function the most powerful Jquery Image zoom-in special effects
  • Php retrieves and outputs a list Of all images in the content
  • Php retrieves remote images and downloads and saves them to a local device.
  • Powerful PHP image processing class (watermark, transparency, zoom, sharpen, rotate, flip, cut, reversed)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.