I particularly like your++ short functional solution.

As for the IE problem… it seems it is more averse to the remove of the original node (also implicite in the original solution with insertBefore.)

So here is a workaround for the IE, avoiding the remove by inserting a cloneNode and display:none the original node.

<script type="text/javascript"> ( function() { var td = document.getElementById( 'nodelet_container' ).parentNode +; var tr = td.parentNode; tr.insertBefore( td.cloneNode(true), tr.firstChild ); td.style.display= "none"; } )(); </script>

This being a workaround has a shortcoming: The script interferes (aborts) the cloneNode, effectively cutting the nodelet tower under "Free Nodelet" at its base. So the "Free Nodelet" has to be the last (highest number) in your nodelet settings.

Mixed users (FF/IE/...) might use this out of the box, or can use a browser switch as in:

<script type="text/javascript"> ( function() { var td = document.getElementById( 'nodelet_container' ).parentNode +; var tr = td.parentNode; if (document.all) { // IE tr.insertBefore( td.cloneNode(true), tr.firstChild ); td.style.display= "none"; } else { // w3c tr.insertBefore( td, tr.firstChild ); } } )(); </script>

also avoiding the free nodelet cut in non-IE.


In reply to Re^4: Free Nodelet Hack: Nodelets on the left by pKai
in thread Nodelets on the left? by Argel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.