Search the web
Sign In
New User? Sign Up
JavaScript_Official · JavaScript . AJAX . ActionScript
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
why these redirect dosent work   Message List  
Reply | Forward Message #16531 of 16813 |
Re: [JavaScript] why these redirect dosent work

Actually, a second thought too ...

You are going to 1280x1024 if you don't get a match on your resolution
check. Shouldn't you be going to 800x600 if you can't identify a higher
resolution.

And also ...

The small net notebooks typically have a resolution of 1024x600. This
should really be treated the same as 1024x768. Probably you should ONLY
look at the width.

Regards, Dave S

----- Original Message -----
From: "osman" <osman_azizi@...>
To: <JavaScript_Official@yahoogroups.com>
Sent: Thursday, January 08, 2009 5:21 AM
Subject: [JavaScript] why these redirect dosent work


> Ok roup, here is the script
>
> if (screen.width==800||screen.height==600) //if 800x600
> window.location.replace("http://adworldcorp.com/800x600.html")
>
> else if (screen.width==1024||screen.height==768) //if 1024x768
> window.location.replace("http://adworldcorp.com/1024x768.html")
>
> else //if all else
> window.location.replace("http://adworldcorp.com/1280x1024.html")
>
>
> There are 2 diferent situations:
> - These scrip work only with 3 options, if not 800x600 it goes and
> check for 1024x768 and if not it goes to 1280x1024, but if u try to
> make check for another resolutions 1024x800 then it dosent work, it
> sent you to 1280x800 even if u have 1280x1024. Now i ask, does the
> scrip only read the width and not width and hight, if so, then the
> problem is that cant have resolutions with same width.
> I am correct o not?
> By the way, sorry for the spelling. Not english spoken.
>
> Thanks
>
>
> ------------------------------------
>
> Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
>
>
>
>




Thu Jan 8, 2009 2:08 am

smartware_co...
Offline Offline
Send Email Send Email

Forward
Message #16531 of 16813 |
Expand Messages Author Sort by Date

Ok roup, here is the script if (screen.width==800||screen.height==600) //if 800x600 window.location.replace("http://adworldcorp.com/800x600.html") else if...
osman
osmanwilson
Offline Send Email
Jan 8, 2009
12:59 am

You are using || which is "OR" not "AND". So the first IF will succeed if the width is 800 OR the height is 600. If you want AND, then use &&. Regards, Dave S ...
David Smart
smartware_co...
Offline Send Email
Jan 8, 2009
2:05 am

This is a simple case of wrong logic. Pseudo-code for the first test, as written, is IF ((width EQ 800) OR (height EQ 600)) THEN which is wrong, because it...
Tim Sabin
timsabin
Online Now Send Email
Jan 8, 2009
2:07 am

Actually, a second thought too ... You are going to 1280x1024 if you don't get a match on your resolution check. Shouldn't you be going to 800x600 if you...
David Smart
smartware_co...
Offline Send Email
Jan 8, 2009
2:08 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help