When opening the web page, it prompts Stack overflow at line: 0. I made a screenshot as follows:
After analysis, it was found that there is code similar to the following in the web page:
<img src="pic.gif" onerror="javascript:this.src='/noPic.gif';" />
Analysis: Pay special attention to onerror. When the picture does not exist, onerror will be triggered, and onerror specifies a NoPic.gif picture for img. That is to say, if the picture exists, pic.gif will be displayed, and if the picture does not exist, noPic.gif will be displayed. But here comes the problem. If noPic.gif does not exist, onerror will continue to be triggered, causing a loop, so an error occurs.
Note: If the picture exists but the network is not smooth, onerror may also be triggered.
Solution: First: Remove the onerror code; or change the onerror code to something else; or ensure that the image in onerror is small enough and exists.
Second type:
<script type="text/javascript">
<!--
function nofind(){
var img=event.srcElement;
img.src="../../../sys/common/image/fileoperation/icon/default.gif";
img.onerror=null; control not to keep beating
}
//When not found, use events to get one by one
//-->
</script>
<td align="center"><img src="../../../sys/common/image/fileoperation/icon/${file.suffix }.gif" onerror="nofind();" / >${file.name}</td>
The third type:
Use two <img />
<style type="text/css">
hidden {
display: none;
}
</style>
<img src="xxx.jpg" onerror="this.class='hidden';xx.class=''" />
<img src="xxx.jpg" />