#1125 enhancement
arno

Element.insert does not allow inserting a text node

Reported by arno | August 20th, 2010 @ 12:57 PM | in After 1.7

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

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Pages