Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    autom. redirect if macintosh

    Does anyone know a Javascript that automatically redirects a surfer to another page if he is using a Macintosh, whatever the Mac-operating system is or the browser he uses? (This should happen to the Mac-user only: the PC user isn't redirected.)
    Thanks!

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    var agt = navigator.userAgent.toLowerCase();
    var is_mac = ( agt.indexOf( "mac" ) != -1 );

    if ( is_mac ) top.location.replace( "somepage.htm" );
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    New Coder
    Join Date
    Nov 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the Javascript... I still have a problem though: I have a domain name "www.allemaalfeesjes.be" which refers to a longer domain name, i.e. "http://users.pandora.be/wwwolf/allemaalfeesjes/index.html".

    The Javascript only works when you use the longer domain name, not when you access the site through the short domain name. Does anyone know how I can solve this problem?

    Thanks thanks thanks!
    Rolf


  •  

    Posting Permissions

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