OK then so im making a website for a company but im going to making it using flash and graphics made in Photoshop. So obviously, I dont want to stretch the page greatly by making graphics suited to 1280x1024 and have the page stretched for users with an 800x600 screen resolution. So I made a code in JavaScript which is supposed to forward you to a page depending on your screen resolution, so I put it into my homepage [index.htm] where the code is like so:
Code:
<html>
<head>
<script language="Javascript1.1">
function detect(){
if(screen.width=1280||screen.height=1024){
location.href('index3.htm');
if(screen.width=1024||screen.height=768){
location.href('index2.htm');
if(screen.width=800||screen.height=600){
location.href('index1.htm');
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body onLoad="detect()" bgcolor="#FF0000">
</body>
</html>
So as you can see it will forward you to index3 if your screen reso is 1280x1024, etc.
The only thing is if the screen reso is 800x600 it wont forward me to index1.htm but it forwards me to index2.htm instead.
Any idea whats wrong?
EDIT - Could I also replace '=' with '<='? would the script still work fine?
Thanks