Does anyone know how to get the height and width of user’s browser window in a Perl CGI script?
Or how can i pass this value to my $var from javascript or other languages ???
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re talking about a perl script that gets called via a form and then prints a web site, you can use javascript to get the browser size, put it into hidden form variables and retrieve them with CGI in your perl script. It can then react to the values, e.g. change the size of a static piece of web layout.
On the web site, use javascript like this:
But keep in mind that different browsers use different ways in JS to get the size values. Maybe this helps. You could also use jQuery to determine these values.
When you have them in your
<form>and submit it, you can use theCGImodule to read them just the same as all the other form parameters. It doesn’t matter if they were sent via POST or GET.