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

Solution to JavaScript error when adding elements using append_javascript skills

WBOY
Release: 2016-05-16 16:42:50
Original
1926 people have browsed it

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

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!