Menu

#7 createElementNS

open
nobody
None
5
2006-08-30
2006-08-30
milton
No

it might be nice to have a wrapper built in for IE
which does not support DOM level 2 createElementNS.

currently i use this:

function createElementNS (namespaceURI, elementName,
ownerDocument) {
var element = null;
if (typeof ownerDocument.createElementNS != 'undefined') {
element = ownerDocument.createElementNS(namespaceURI,
elementName);
}
else if (typeof ownerDocument.createNode != 'undefined') {
element = ownerDocument.createNode(1, elementName,
namespaceURI);
}
return element;
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB