Home > Web Front-end > JS Tutorial > body text

Errors caused by spaces in javascript development_javascript skills

WBOY
Release: 2016-05-16 18:16:57
Original
1065 people have browsed it

Without further ado, let me show you the code first

Copy the code The code is as follows:


< ;html xmlns="http://www.w3.org/1999/xhtml">


Yiyi Garden















Please run the above code 2 in Firefox and IE respectively. What appears in Firefox is [object HTMLImageElement], while what appears in IE is [object], here both IE and Firefox regard the object picList[0].firstChild as the object object. Firefox prompts that it is an HTMLImageElement type object, and IE does not prompt more details.
The difference between the upper and lower writing methods is only indentation and line breaks. They are recognized as the same object in IE, but different indentations represent different objects in Firefox. Firefox’s parsing of HTML is really puzzling. .
I will record this again, I hope it will be useful to all my friends, and don’t end up having the same problem as me and not finding a solution for a long time.
Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template