JDD,
didn't want to rise extra issues, your code and the lazy
initialization are perfect and fast, but if I remember correctly I
preferred to leave out native IE swapNode because it was impossible
to do swaps between DOM nodes of different contexts (documents), but I
may recall it wrong !
In
Awesome use of nextSibling and parentNode!
I have added my version which checks for the existence of the
element.swapNode method (in IE).
You can find it posted in the ticket.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
On Sep 23, 11:25 am, John-David Dalton [EMAIL PROTECTED]
wrote:
@Tag can you provide a case where this would be a real issue ?
I can't see someone swapping nodes with the document.documentElement
or anything.
I think `Element.replace` is a good way to ensure no cross-browser
bugs crawl in
Shouldnt it use the parent node of both elements ??
Cause if i decide to swap 'div1' and 'div2' here ill have no
nextSibling (assuming that no textNodes would be returned as
siblings)...
div
div
div id=div1/div
/div
div
div id=div2/div
/div
/div
EMoreth
On Sep 23, 5:04
Using native IE method (swapNode) might help for weird issues in table.
http://msdn.microsoft.com/en-us/library/ms536774(VS.85).aspx
if (element.swapNode) return element.swapNode(secondElement);
2008/9/23 EMoreth [EMAIL PROTECTED]
Shouldnt it use the parent node of both elements ??
Cause
@Kangax
I am not aware of any issues with insertBefore and table elements. I
know that IE has issues with innerHTML and table/select elements.
@EMoreth
if nextSibling is null insertBefore will act as appendChild so it
should still work out.