Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element.insert does not allow inserting a text node #126

Open
jwestbrook opened this issue Apr 22, 2014 · 0 comments
Open

Element.insert does not allow inserting a text node #126

jwestbrook opened this issue Apr 22, 2014 · 0 comments

Comments

@jwestbrook
Copy link
Collaborator

previous lighthouse ticket #1125
by arno


Hi,
Element.insert(node) does not work when node is a text node:

var el = new Element('a', { href: 'link'});
var text = document.createTextNode('content');
el.insert(text);

will fail with exception:
"insert is undefined" on line 2054 for 1.7_rc2

that's because

if (Object.isString(insertions) || Object.isNumber(insertions) ||
    Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants