[Proto-Scripty] Re: Remove an element from the DOM and add it later exactly to the same point

2009-02-18 Thread T.J. Crowder
Hi, FWIW, I think you can avoid the branching. To remember an element's position and then remove it: * * * * function saveAndRemoveElement(elm) { var saved; saved = { elm:elm, parent: elm.parentNode, next: elm.nextSibling // = May be undefined, that's

[Proto-Scripty] Re: Remove an element from the DOM and add it later exactly to the same point

2009-02-18 Thread RobG
On Feb 19, 3:55 pm, RobG rg...@iinet.net.au wrote: [...] *Do not* use Prototype.js's sibling array as it will remove text nodes, you certainly don't want to do that. Not worded quite right: Prototype.js doesn't include text nodes in its sibling arrays, but they should be used in this case so