[_] Script to move DOM node up/down its siblings
Tim Beadle
tim.beadle at gmail.com
Thu Jun 2 20:35:13 BST 2005
On 6/2/05, Rupert Jabelman <rupert at jabelman.org> wrote:
> What about this?
> http://jabelman.org/rupert/domtest.php
Rupert,
Thanks for that - that's incredibly concise code!
It still displays the empty text node problem at the top of the list
(try moving the 2nd paragraph up to the top position) in Gecko-based
browsers, and I notice you've put all the HTML on one line, avoiding
creating too many empty text nodes.
One version I did looped through the childNodes collection and removed
any textNodes, which is a bit of a sledgehammer, but worked. I shall
keep investigating.
Cheers,
Tim
> What about this?
> http://jabelman.org/rupert/domtest.php
Rupert,
Thanks for that - that's incredibly concise code!
It still displays the empty text node problem at the top of the list
(try moving the 2nd paragraph up to the top position) in Gecko-based
browsers, and I notice you've put all the HTML on one line, avoiding
creating too many empty text nodes.
One version I did looped through the childNodes collection and removed
any textNodes, which is a bit of a sledgehammer, but worked. I shall
keep investigating.
Cheers,
Tim