in reply to Detecting web clients monitor resolution without javascript

You can't really. One way to do something like this is to use JavaScript to set a hidden field on a login page or some such that pushes that ingo bhack to your CGI. the issue is that a user can change his window size anytime. Why not just write HTML that looks good no matter what size the window is?

-Waswas

Replies are listed 'Best First'.
Re: Re: Resolution
by peregrine (Acolyte) on Jan 15, 2003 at 08:25 UTC
    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.
Re^2: Resolution
by Anonymous Monk on Apr 18, 2016 at 14:39 UTC
    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.

      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