Parsing an IMG image did not find the OnError event

Source: Internet
Author: User

  This article mainly introduces the IMG image did not find onerror event Stack overflow at line:0 need friends can come to the reference, I hope to help you.

Prompts Stack overflow at line:0 when opening a Web page. I made a screenshot as follows:    after analysis, found that the Web page is similar to the following code:   <img src= "pic.gif" onerror= "javascript:this.src= '/nopic.gif ';" alt= "pic"/>   Analysis: Pay special attention to onerror, when the picture does not exist, will trigger OnError, and onerror for the IMG to specify a nopic.gif picture. That is to say, the picture exists to display pic.gif, the picture does not exist will show nopic.gif. But the problem is, if nopic.gif does not exist, then continue to trigger onerror, resulting in loops, so there are errors.   NOTE: If the picture exists, but the network is not smooth, it may also trigger onerror.   Solution: The first::. Remove onerror code, or change the onerror code for other, or make sure the picture in onerror is small enough and exists.   Second: <script type= "Text/javascript" >   <!--      function Nofind () {    &NB Sp     VAR img=event.srcelement;           img.src= ". /.. /.. /sys/common/image/fileoperation/icon/default.gif ";     Img.onerror=null;       Control don't keep bouncing        }  ///Get a get one with event when not found </script  //-->   >     <TD align= "center" ><img src= ". /.. /.. /sys/common/image/fileoperation/icon/${file.suffix}.gif "ONerror= "Nofind ();"/>${}</td>        Third: Using two <img/>    < Style type= "Text/css" >  hidden {  display:none; }  </style>  <img src= "Xxx.jpg" Onerror= "this.class= ' hidden"; xx.class= ' "/>  <img src=" xxx.jpg "class=" hidden "/>    
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.