http://www.perlmonks.org?node_id=986606

PriNet has asked for the wisdom of the Perl Monks concerning the following question:

Here Goes: I arrange my webpage depending on the clients browser window size. Currently I'm trying to figure out the height of the remaining div (in pixels) after I subtract the heights of other divs from the overall height (wich i have in a perl variable after client links into my page). Where I'm stuck is trying to find the height of the dynamic divs in a perl variable. I see there is a way in javascript of course, but I need the parameter in perl when I set the size of the middle div. I use jsdump to pass parameters from perl to javascript, what i need is the reverse, a way to pass javascript parameters back to perl so i can use the ("#myDiv").height(); when setting my middle div. here is a (very) rough outline of the structure:
<HTML> <DIV ID="Top" WIDTH=100> this is a dynamic div depending on contents </DIV> <DIV ID="Middle" WIDTH=100 HEIGHT={page/window height - "Top" div heig +ht - "Bottom" div height)> whats left of window </DIV> <DIV ID="Bottom" WIDTH=100> this is a dynamic div depending on contents </DIV> </HTML>
Again, i'm trying to get (in perl) the heights of the top and bottom divs so as to figure what height to set the middle div to so i remain inside the browsers window without a scrollbar showing up. I really hope i explained myself correctly, i could use this result in alot of my page, i try to fit (even up to resizing text/images) everything into the clients prefered browser window size. I'm trying to avoid scrollbars, this causes missed data from the viewable area, beside being encumbersome.. *heh*...

I did try re-inventing the wheel...
But it kept getting stuck on the corners