Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default Display a message to Opera and Safari Users

    Hii

    I'm developing a site, an di've just tested it in Opera and Safari,
    In Opera, the scripts don't work so site litterally doesn't work lol
    and in Safari it works but font is weird lol.

    So is there a way i can make some text come up if they're using any of those browsers to recomend they use IE, FF oR GC?

    Thanks
    Luke

  2. #2
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Code:
    <script>
    
    //Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and Terms Of Use, 
    //visit dynamicdrive.com
    
    var browser_type=navigator.appName
    var browser_version=parseInt(navigator.appVersion)
    
    //if NS 6
    if (browser_type=="Netscape"&&browser_version>=5)
    window.location.replace("http://mozilla.org")
    //if IE 4+
    else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
    window.location.replace("http://microsoft.com")
    //if NS4+
    else if (browser_type=="Netscape"&&browser_version>=4)
    window.location.replace("http://www.netscape.com")
    //Default goto page (NOT NS 4+ and NOT IE 4+)
    else
    window.location="http://www.dynamicdrive.com"
    </script>
    Edit that

  3. #3
    Join Date
    Aug 2008
    Location
    Swindon, Wiltshire, Southwest
    Posts
    36
    Tokens
    5,569

    Latest Awards:

    Default

    Quote Originally Posted by Calon View Post
    Code:
    <script>
    
    //Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and Terms Of Use, 
    //visit dynamicdrive.com
    
    var browser_type=navigator.appName
    var browser_version=parseInt(navigator.appVersion)
    
    //if NS 6
    if (browser_type=="Netscape"&&browser_version>=5)
    window.location.replace("http://mozilla.org")
    //if IE 4+
    else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
    window.location.replace("http://microsoft.com")
    //if NS4+
    else if (browser_type=="Netscape"&&browser_version>=4)
    window.location.replace("http://www.netscape.com")
    //Default goto page (NOT NS 4+ and NOT IE 4+)
    else
    window.location="http://www.dynamicdrive.com"
    </script>
    Edit that
    What if JS is turned off....

    Ask someone to make a PHP file, grabbing HTTP_USER_AGENT, then say for me, it return "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1.", you can see im using Firefox, version 3.0.1.

    Im in bed, so I cba to code.

  4. #4
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default

    hmm, could you maybe code it when your out of bed please (+rep ), as i'm having trouble understanding that.

    At above, thanks for trying but ye, javascript is the problem in the first place

  5. #5
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    90

    Latest Awards:

    Default

    PHP Code:
    <?php
    $agent 
    $_SERVER["HTTP_USER_AGENT"];

    if(
    eregi('Opera'$agent)) {
    echo(
    "You are using Opera");
    }

    if(
    eregi('Firefox'$agent)) {
    echo(
    "You are using Firefox");
    }
    ?>

  6. #6
    Join Date
    Feb 2008
    Location
    Greater Manchester
    Posts
    24
    Tokens
    0

    Default

    Why not just develop the site to work in Opera, I wouldn't change browsers just to browse a site, and what about text-only browsers, you should make your website accessible to everyone.

Posting Permissions

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