Home > Web Front-end > JS Tutorial > Onerror usage in img tag_javascript skills

Onerror usage in img tag_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:48:16
Original
1456 people have browsed it

Today I saw a TX who wrote the following code in HTML
Hey! It's ok on FF but not on IE, because there are many factors that cause onerror in the B/S structure. Here, when an onerror occurs, re-address the current picture
However, this will cause network reasons or If the image cannot be loaded normally for other reasons, onerror will be called again. A browser based on Microsoft's core set will think that this is an infinite loop
and will report a stack overflow error.
Solution:
Use two

Copy the code The code is as follows:




Related labels:
img
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
img tag
From 1970-01-01 08:00:00
0
0
0
js find child node img and change src
From 1970-01-01 08:00:00
0
0
0
css - img tag has border
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template