Home Web Front-end JS Tutorial Solution to JavaScript error when adding elements using append_javascript skills

Solution to JavaScript error when adding elements using append_javascript skills

May 16, 2016 pm 04:42 PM
append Add element

1. Error description

On IE browser:

Uncaught HierarchyRequestError:Failed to excute 'appendChild' on 'Node':The new child element contains the parent.

On Google Chrome:

SCRIPT5022:DOM Exception:HIERARCHY_REQUEST_ERR(3) error

2. Error reason

Include append() within append()

For example:

append(append("String"));
Copy after login

3. Solution

Remove the append in append and put the string in the inner append into the outer append

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

Use java's StringBuilder.append() function to splice strings Use java's StringBuilder.append() function to splice strings Jul 26, 2023 am 09:18 AM

Use Java's StringBuilder.append() function to splice strings. In Java programming, string splicing is a very common operation. In order to efficiently splice strings, Java provides the StringBuilder class, whose append() function can quickly join multiple strings together. StringBuilder is a variable character sequence that is more efficient to use than the String class. When we need to concatenate a large number of strings, use

Java program to add elements to LinkedList Java program to add elements to LinkedList Aug 26, 2023 pm 10:21 PM

LinkedList is a general class of JavaCollectionFramework, which implements three interfaces: List, Deque and Queue. It provides the functionality of the LinkedList data structure, a linear data structure in which each element is linked to each other. We can perform a variety of operations on a LinkedList, including adding, removing, and traversing elements. To add elements to the LinkedList collection, we can use various built-in methods such as add(), addFirst(), and addLast(). We will explore how to use these methods to add elements to a LinkedList. in Java

How to use append in python How to use append in python Nov 14, 2023 am 10:41 AM

In Python, append() is a method of the list object that is used to add an element to the end of the list. It should be noted that the append() method can only be used for list objects and cannot be used for other types of objects. In addition, the append() method will directly modify the original list without returning a new list.

How to use append How to use append Oct 25, 2023 pm 03:14 PM

append is a commonly used command line tool used to append the contents of one file to the end of another file. The usage of the append command is "append [option] source file target file", where the source file is the file to be appended and the target file is the file to be appended.

How to use the append() method of the StringBuilder class to splice strings in Java How to use the append() method of the StringBuilder class to splice strings in Java Jul 25, 2023 pm 03:05 PM

How to use the append() method of the StringBuilder class to splice strings in Java. Splicing strings is a common operation in Java. During the splicing process, if the basic String class is used for string addition, new String objects will be created frequently, thus affecting performance. In order to solve this problem, Java provides the StringBuilder class to perform string splicing operations. StringBuilder class is one of the Java

Python program: add elements to first and last position of linked list Python program: add elements to first and last position of linked list Aug 23, 2023 pm 11:17 PM

In Python, a linked list is a linear data structure that consists of a sequence of nodes, each node containing a value and a reference to the next node in the linked list. In this article, we will discuss how to add elements to the first and last position of a linked list in Python. LinkedList inPython A linked list is a reference data structure used to store a set of elements. It is similar to an array in a way, but in an array, the data is stored in contiguous memory locations, whereas in a linked list, the data is not subject to this condition. This means that the data is not stored sequentially but in a random manner in memory. Thisraisesonequestionthatis,howwecanac

Tips and things to note when adding elements to an array in Java Tips and things to note when adding elements to an array in Java Jan 03, 2024 pm 02:01 PM

Tips and precautions for adding elements to arrays in Java In Java, arrays are a very common and important data structure. It can store a set of elements of the same type, and these elements can be accessed and modified through indexes. In practical applications, we often need to dynamically add elements to an array. This article will introduce some tips and precautions for adding elements to arrays in Java, and provide corresponding code examples. Use dynamic array (ArrayList) to add elements Dynamic array ArrayList is

array_push() function in PHP: how to add elements to the end of an array array_push() function in PHP: how to add elements to the end of an array Nov 04, 2023 pm 03:48 PM

array_push() function in PHP: How to add elements to the end of an array, with code examples In PHP, arrays are a very important data type that allow us to save and organize multiple values. Sometimes, we need to add new elements to an existing array. PHP provides an array_push() function to conveniently add elements to the end of an array. This article will introduce the usage of array_push() function and provide specific code examples. First, let's take a look at

See all articles