Browser Detection?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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?
 
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.
 

tomdkat

Retired Trusted Advisor
Joined
May 6, 2006
Messages
7,148
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.
I agree. It looks like the CSS styling needs to be "massaged" a bit for IE.

Peace...
 

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.
 

tomdkat

Retired Trusted Advisor
Joined
May 6, 2006
Messages
7,148
i still don't know how i am to "massage" it into IE, seems easier to have a script to detect the browser.
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...
 
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]-->
 
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.
 
Joined
Dec 6, 2003
Messages
1,938
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
 

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.
 

tomdkat

Retired Trusted Advisor
Joined
May 6, 2006
Messages
7,148
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.
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...
 
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.)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top