Advanced Search

Results 1 to 5 of 5

Thread: Detect Browser type and Display Text message

  1. #1
    Join Date
    Nov 2005
    Location
    Utica, NY
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Detect Browser type and Display Text message

    I've been looking for a script that will detect a surfers browser type and version and display a text message with directions for a the browser type and version i say.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's impossible to do perfectly. You can best attempt it with Javascript:
    Code:
    <div id="instructions-opera" style="display: none;">
      Instructions for Opera...
    </div>
    <div id="instructions-ie" style="display: none;">
      Instructions for IE...
    </div>
    <div id="instructions-generic">
      Generic instructions...
    </div>
    
    <script type="text/javascript">
      var btype = "generic";
      document.getElementById("instructions-" + btype).style.display = "none";
    
      if(window.opera) btype = "opera";
      else if(window.ActiveXObject) btype = "ie";
    
      document.getElementById("instructions-" + btype).style.display = "block";
    </script>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    where would it be processed?
    what language?

    see this article for the forum rules about posting

  4. #4
    Join Date
    Nov 2005
    Location
    Utica, NY
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I was hoping for JS

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    boogyman, this would be the right forum to post in being that there is no question about a particular scripting language, but instead they are looking for this specific service.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •