This is what I have so far: http://jsfiddle.net/beCVL/5/
This is how I’m trying to override the default cloneNode:
Object.defineProperty(Object.prototype, “cloneNode”, {
get: cloneNode2,
set: cloneNode2
});
but it’s not working, so, I think Object.prototype doesn’t have cloneNode, but Element.prototype doesn’t either.
So, which class do I need to use to override cloneNode, assuming my method is correct?
This series of fiddles is a work in progress, but it reimplements cloneNode’s functionality. http://jsfiddle.net/beCVL/19/
as of April 4th, 10:53am EST, it needs to work with IE, as IE doesn’t have a Node object.
Note, that in IE, prototype functions can’t be overridden. So, all instances of cloneNode have to be replaced by a function that determines which version of cloneNode to use.