Question: How do I get the screen size on the client machine?
Answer: To determine the screen size on the client machine, use the properties
supported in all major browsers.
If you need a reduced value (subtracting the screen portion occupied by toolbars etc.), use
Historical note: For Netscape Navigator 3 (with Java enabled), you could use a Java call to get the screen width and height (see the example below).
The following code sets the variables
to the actual width and height of the screen, and outputs the width and height values. If the user has an old browser, then
are set to 640 and 480, respectively.
In your browser, this code produces the following output: