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

Errors caused by spaces in javascript development_javascript skills

May 16, 2016 pm 06:16 PM
space

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 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What does a space mean in mysql? What does a space mean in mysql? Jul 20, 2023 pm 05:17 PM

MySQL A space is a special character used to separate keywords, identifiers, values, and other statement elements. Spaces can be used in multiple locations in a SQL statement and usually do not affect the execution of the statement. The purpose of spaces: 1. Used to separate keywords and identifiers; 2. Used to separate operators and values; 3. Used to separate functions, columns and table aliases; 4. Used for indentation and alignment.

The difference between full-width spaces and half-width spaces The difference between full-width spaces and half-width spaces Mar 25, 2024 pm 12:45 PM

The difference between full-width spaces and half-width spaces. When we use word processing software or edit text content, we sometimes encounter the concept of spaces. Space is a very basic element in typesetting and formatting text, but many people may not know the difference between full-width spaces and half-width spaces. In daily use, we may feel that full-width spaces and half-width spaces have different effects in different situations, but we may not be aware of the subtle differences. First of all, the difference between full-width spaces and half-width spaces is the width they occupy.

How to replace spaces in vue How to replace spaces in vue Dec 22, 2022 am 09:40 AM

How to replace spaces in Vue: 1. Create a Vue sample file; 2. Replace all spaces through the regular expression "string = string.replace(/\s/g," ");"; 3. Through "console. log(string);" just output the replaced string.

How to use spaces correctly in Go How to use spaces correctly in Go Mar 29, 2024 pm 03:42 PM

Go language is a simple, efficient, and highly concurrency programming language. It is an open source language developed by Google. In the Go language, the use of spaces is very important, it can improve the readability and maintainability of the code. This article will introduce how to use spaces correctly in Go language and provide specific code examples. Why you need to use spaces correctly In the programming process, the use of spaces is very important for the readability and beauty of the code. Appropriate use of spaces can make code clearer and easier to read, thus reducing

What is the difference between full-width spaces and half-width spaces? What is the difference between full-width spaces and half-width spaces? Mar 15, 2024 pm 03:49 PM

Differences: 1. The display width of full-width spaces is the same as that of Chinese characters, occupying two bytes. You need to use the Chinese input method when inputting, while the width of half-width spaces is half that of Chinese characters, occupying one byte, just press the space key. Can be input; 2. When typesetting text, full-width spaces make the layout more relaxed, while half-width spaces make the layout more compact.

Sharing of practical techniques for replacing spaces in Golang Sharing of practical techniques for replacing spaces in Golang Mar 13, 2024 am 09:15 AM

Title: Sharing practical techniques for replacing spaces in Golang. With the popularity and development of the Internet, program design and development have become more and more important. In the programming process, data processing is a very critical part. When processing text data, you often encounter situations where you need to replace spaces. This article will share how to implement the technology of replacing spaces in Golang and provide specific code examples. Why do I need to replace spaces? Spaces are one of the common special characters in text data. Sometimes we need to replace spaces with other characters or remove spaces.

What should I do if spaces automatically appear after typing in WPS? How to cancel the space automatically appearing after typing in WPS What should I do if spaces automatically appear after typing in WPS? How to cancel the space automatically appearing after typing in WPS Mar 13, 2024 pm 05:40 PM

WPS is a very easy-to-use office software, but many users are asking what to do if spaces automatically appear after typing in WPS? Let this site introduce to users in detail how to cancel the automatic space appearing after typing in WPS. How to cancel the space automatically appearing after typing in WPS 1. Check the keyboard settings: First, check whether the keyboard settings are normal. Some keyboards may have special function keys or shortcut keys. For example, the space bar may be set to enter multiple spaces in a row. Make sure the keyboard doesn't trigger any unusual settings. 2. Check the input method settings: If you use input method software, please check its settings. Some input methods may have an automatic space function that needs to be turned off manually. Enter the input method settings and find the corresponding

Python program to replace spaces in string with specific characters Python program to replace spaces in string with specific characters Aug 25, 2023 pm 02:29 PM

In Python, you can use the replace() method to replace spaces with special characters in a string. The replace method replaces all occurrences of a substring with a new substring. In this article, we will see how to replace the spaces of a string with another specific substring using the replace() method. The syntax of the Replace method The syntax of the replace method is as follows: string.replace(old,new[,count]) The replace method accepts two inputs, one is the old string, which is the substring to be replaced, and the other input is the new string. , that is, the substring to be placed at the position of the old substring, and a count parameter to specify the

See all articles