Home >Web Front-end >JS Tutorial >Errors caused by spaces in javascript development_javascript skills

Errors caused by spaces in javascript development_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:16:571089browse

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.
Statement:
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