This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Screen resolution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Screen resolution" Watch "Screen resolution" New topic

Screen resolution

Jeff Dube
Ranch Hand

Joined: Jun 14, 2001
Posts: 44
Hi again,
I am unable to get the right screen resolution. Iu always get on the 800x600 resolution. Here is part of my code:
<SCRIPT Language="JavaScript">
if((screen.width >= 800) && (screen.height >= 600))
location.href = "800x600.html"
location.href = "1024x768.html"
No mather what the resolution is, i always get the 800x600 page. I tried it on several computer--> always the same result
Can somebody help me???
xavier romea
Ranch Hand

Joined: Jun 28, 2001
Posts: 37
your condition will be true if the screen resolution is over 800x600, therefore, you'll get always the 800x600 page for high resolution
maybe if you set this condition
if((screen.width <= 800) && (screen.height <= 600))
it would work
I agree. Here's the link:
subject: Screen resolution
It's not a secret anymore!