SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ways to achieve cross browser detection

    I have been looking around the web for articles that talk about browser detection and ways to implement javascripts that detect a user's browser. I've found a few useful articles, but I'm now wondering which technique I should use. I found one script that talks about directing visitors to different web pages based on their browser, but I'm reluctant to use this because I'd have 2 copies of most pages and different URLs of the same page.

    I also found a script that detects a user's browser and loads a style sheet that is written for that specific browser. This also seems complex and it could open up a new set of problems.

    Does anyone have any advice on this topic?

    By the way, here are some links to articles I've found:
    http://www.webreference.com/js/column6/browser.html
    http://www.echoecho.com/jsbrowserdetection.htm
    http://hotwired.lycos.com/webmonkey/...l?tw=authoring

  2. #2
    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)
    Well I think the answer should be fairluy obvious -- if you want to have a site that works in all browsers, BUT looks the same then you have two options:

    1) Write a site which looks fine in all browsers (hard, and at the expense of some components but efficient and easy to maintain)

    2) Write one/two different copies of the site for IE/NS/Opera whatever (not too bad but involves extra coding etc).

    Of course if you are using templates then you would only need to create one or two different files, since all of your content can just be plugged into the middle of it.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For javascript browser detection you have found the best tutorial around. The webreference ones go into great detail. You could also do something similar with PHP (which wouldn't rely on js being turned on)

    http://www.webmasterbase.com/article/619

    Either way or using both is your best option for multiple style sheets. And of course templating as mentioned above is a wonderful thing
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.


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
  •