Web Analytics Made Easy -
StatCounter PLEASE HELP! Autodetect and Re-Routing - CodingForum

Announcement

Collapse
No announcement yet.

PLEASE HELP! Autodetect and Re-Routing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PLEASE HELP! Autodetect and Re-Routing

    Hi guys! I would really appreciate your help on this one. My site is ready to go live but I need to direct visitors with different resolutions to the different versions of my site. I have made one for 1024x768 visitors and one for 800x600 visitors. I have found this script....see below.....but dont know how to use it. How do I make it work? I am using Dreamweaver 3 and just copying it and pasting it into the code editor doesnt work. WHAT DO I DO? PLEASE HELP

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function redirectPage() {
    var url640x480 = "http://www.yoursite.com/640x480";
    var url800x600 = "http://www.yoursite.com/800x600";
    var url1024x768 = "http://www.yoursite.com/1024x768";
    if ((screen.width == 640) (screen.height == 480))
    window.location.href= url640x480;
    else if ((screen.width == 800) (screen.height == 600))
    window.location.href= url800x600;
    else if ((screen.width == 1024) (screen.height == 768))
    window.location.href= url1024x768;
    else window.location.href= url640x480;
    }
    // End -->
    </SCRIPT>

    In the opening body tag of the HTML document, add the following statement <body onload="redirectPage()">

  • #2
    try this
    Code:
     <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function redirectPage() {
    var url640x480 = "http://www.yoursite.com/640x480";
    var url800x600 = "http://www.yoursite.com/800x600";
    var url1024x768 = "http://www.yoursite.com/1024x768";
    if ((screen.width == 640) [COLOR=Teal]&&[/COLOR] (screen.height == 480))
    window.location.href= url640x480;
    else if ((screen.width == 800) [COLOR=Teal]&&[/COLOR] (screen.height == 600))
    window.location.href= url800x600;
    else if ((screen.width == 1024) [COLOR=Teal]&&[/COLOR] (screen.height == 768))
    window.location.href= url1024x768;
    else window.location.href= url640x480;
    }
    // End -->
    </SCRIPT>
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

    Comment

    Working...
    X