Javascript is really the best way i've seen to do this. If you absolutely have to have the current browser dimensions, then there is a way I can see that you can do this.
What you would have to do is make the perl script display a page with the a subroutine which reloads the script, but passes the page dimensions. The script would then load the actual page. To handle browser resizing, you would then have the page reload itself everytime the browser was resized (using the onresize javascript function i.e. <BODY onresize="onResize();"> ) Your javascript function just needs to feed the new size details back to the perl script.
Hope that makes sense - not elegant, but it would be a way of doing it. | [reply] |
of course you can if you use device size dependant css rules and import an url e.g. in form of an 1px gif dummy that submits the width / height as get parameters. of course that would cause a big css file that you would probably generate using a script, but it *is* possible to track the dimension without any javascript in pure css and submit it back to the server. | [reply] |
This is a 13 year old thread. Better to start your reply with, "Today you could try this monstrous hack that wouldn't work on some browsers and might need a couple dozen subrules to account for view-port resolution and browser behavior" instead of, "Of course you can." :P
| [reply] |