Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Free Nodelet Hack: Nodelets on the left

by Argel (Prior)
on Nov 09, 2006 at 01:36 UTC ( [id://583018]=note: print w/replies, xml ) Need Help??


in reply to Re: Free Nodelet Hack: Nodelets on the left
in thread Nodelets on the left?

Looks like IE6 is blowing up on the insertBefore -- I get a pop-up message saying the page cannot be displayed (either that or we have some software that thinks the script is doing something dangerous). Anyone have any ideas how to get this to work with IE? Or why ikegami's works (node 582545) but this one fails? I tried googling for answers and various code tweaks but I never really made any progress. :-(

Update:Ooops! By "work" I meant why does his not blow up in Interent Explorer? In other words, what's different about his insertBefore? You're right -- it doesn't move the nodelets. Sorry for the confusion!!!

Replies are listed 'Best First'.
Re^3: Free Nodelet Hack: Nodelets on the left
by Aristotle (Chancellor) on Nov 09, 2006 at 01:41 UTC

    According to the note in ikegami’s node, his code shouldn’t work in IE6 either. Does it work if you change it to the following?

    tr.insertBefore( tr.removeChild( td ), tr.firstChild );

    Makeshifts last the longest.

      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.

        Hmm, I tried both under IE6 and I only see the XP nodelet and the top of the freenodelet (i.e. the title cell is fine but body cell is empty and compressed vertically). I must say I have new respect for those of you dealing with browser differences!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://583018]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-28 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found