SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please test a script for me

    Hi,

    I need to redirect visitors depending initially on their browser, but more importantly on their screen resolution.

    I am using this:

    PHP Code:

    <SCRIPT LANGUAGE="JavaScript">

    function 
    redirectPage() {
    var 
    page640x480 "http://www.weirdbeard.f2s.com/test/640.html";
    var 
    page800x600 "http://www.weirdbeard.f2s.com/test/800.html";
    var 
    page1024x768 "http://www.weirdbeard.f2s.com/test/1024.html";
    var 
    page1640x768 "http://www.weirdbeard.f2s.com/test/1640.html";
    var 
    pagenetscape "http://www.weirdbeard.f2s.com/test/netscape.html";
    var 
    pageopera "http://www.weirdbeard.f2s.com/test/opera.html";


    if (
    navigator.appName == 'Netscape')
    window.location.hrefpagenetscape;
    else if (
    navigator.appName == 'Opera')
    window.location.hrefpageopera;
    else if ((
    screen.width == 640) && (screen.height == 480)) 
    window.location.hrefpage640x480;
    else if ((
    screen.width == 800) && (screen.height == 600))
    window.location.hrefpage800x600;
    else if ((
    screen.width == 1024) && (screen.height == 768))
    window.location.hrefpage1024x768;
    else 
    window.location.hrefpage1640x480;
    }

    </script> 
    Could you check that it works for me, because I only have IE5 and NS6.

    Specifically I'd like Opera users/ older NS browsers and people at different resolutions -- can you post your specs after testing?

    *edited out address - it works fine*

    Thanks a lot
    Last edited by weirdbeardmt; Sep 2, 2001 at 13:08.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •