1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Browser Detection?

Discussion in 'Web Design & Development' started by num, Mar 30, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. num

    num Thread Starter

    Joined:
    Oct 22, 2005
    Messages:
    263
    How can I make it so that my site can detect what browser is being used? My site is designed for firefox only, how can i create a portion that detects what browser the user is viewing my site with and pop up a different page overiding the entire site if its not firefox?
     
  2. MMJ

    MMJ Guest

    Joined:
    Oct 15, 2006
    Messages:
    3,625
  3. Fyzbo

    Fyzbo

    Joined:
    Feb 6, 2002
    Messages:
    1,683
    What about your website is FF only? Can you provide the url. It may not be too difficult to modify the site to work in most browsers, then you will not have to exclude potential visitors or make a completely different version.
     
  4. num

    num Thread Starter

    Joined:
    Oct 22, 2005
    Messages:
    263
  5. tomdkat

    tomdkat Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,141
    I agree. It looks like the CSS styling needs to be "massaged" a bit for IE.

    Peace...
     
  6. num

    num Thread Starter

    Joined:
    Oct 22, 2005
    Messages:
    263
    i still don't know how i am to "massage" it into IE, seems easier to have a script to detect the browser.
     
  7. tomdkat

    tomdkat Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,141
    Using a browser detection script might appear to be easier, but it's not the right thing to do AND the CSS tweaks for IE might prove to be even easier once we know what those are. :)

    I saw the other thread you started and we can use that thread to address the CSS issues.

    The point is to design your site correctly so it functions across browsers correctly not to design sites that are "easy" that work in one or two browsers only. :)

    Peace...
     
  8. num

    num Thread Starter

    Joined:
    Oct 22, 2005
    Messages:
    263
    but that is the design i need.
     
  9. Fyzbo

    Fyzbo

    Joined:
    Feb 6, 2002
    Messages:
    1,683
    If you are not willing to rework the css for all browsers the easy way would be using dean edwards ie8. Easier then browser detection and allows visitors to use IE.

    http://code.google.com/p/ie7-js/

    Just include this code snippet in the html <head>

    <!--[if lt IE 8]>
    <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
    <![endif]-->
     
  10. Fyzbo

    Fyzbo

    Joined:
    Feb 6, 2002
    Messages:
    1,683
    Just to let you know, the pages are not consistent in Firefox. Background change, padding changes, and the phone number shifts(is it supposed to be off to the left like that???) when I go from page to page.
     
  11. Courtneyc

    Courtneyc

    Joined:
    Dec 6, 2003
    Messages:
    1,906
    The problem isn't that it's made for FireFox. The problem is that the site is not in XHTML Strict 1.0 format (it fails validation). So each browser has to make a guess as to what you really want the site to look like.

    FireFox guesses correctly. IE guesses incorrectly. If you make the site true XHTML, both will look correct.

    Courtney
     
  12. num

    num Thread Starter

    Joined:
    Oct 22, 2005
    Messages:
    263
    thanks as for the phone numbers, no they shouldn't be moving around, but i cannot figure a way out on how to anchor them.
     
  13. tomdkat

    tomdkat Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,141
    The problem with the numbers isn't they are moving but they are NOT moving with the rest of the page when the browser window is resized.

    Go check out your other thread. :)

    Peace...
     
  14. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    You need to get rid of the "." before the doctype. It's causing, IE, Opera and Safari to use quirks mode. CSS won't completely work right if the browser isn't in standards mode.

    http://www.opera.com/docs/specs/doctype/

    (Firefox differs here and the "." doesn't trigger quirks mode. This is why you need to always check in Opera, Safari, IE (and Konqueror if possible) and don't just assume that FF is correct.)
     
  15. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/698737