I've been looking for the past week for a way to find out when someone comes to my web page what their screen resolution is, etc. in CGI/Perl. What I think is needed is to run a Java script, then pass that variable to CGI/Perl. Can some please email me some simple code that will show me how to do this? Here is my URL: http://linux-serv.mendocino.cc.ca.us/~thammack/ Click on "Final Project"
This conversation is currently closed to new comments.
This script will get you the user's screen resolution. The first line is IE only; the second works in both IE and Netscape.
<script language="JavaScript1.2"> if (window.screen) { document.write('screen.Width x screen.Height: '+screen.Width+'x'+screen.Height+'<br>'); document.write('screen.availWidth x screen.availHeight: '+screen.availWidth+'x'+screen.availHeight+'<br>'); } </script>
The following works fine. <script language="JavaScript"> <!-- var width = screen.width; var height = screen.height; //--> </script> You can use the variables width and height to set the size of fonts, the screen available height and width or anything else you want to control according to their screen size.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Getting users Screen Resolution
What I think is needed is to run a Java script, then pass that variable to CGI/Perl.
Can some please email me some simple code that will show me how to do this?
Here is my URL: http://linux-serv.mendocino.cc.ca.us/~thammack/ Click on "Final Project"