Home >Web Front-end >JS Tutorial >Solution to JavaScript error when adding elements using append_javascript skills
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"));
3. Solution
Remove the append in append and put the string in the inner append into the outer append