Re-direct to one of two urls depending on the browser used?
Moderator: General Moderators
-
shaunguyver
- Forum Newbie
- Posts: 3
- Joined: Wed Aug 15, 2007 8:46 am
Re-direct to one of two urls depending on the browser used?
Hello all. I have a problem -
http://www.guyverdesign.com
The above url works perfectly in IE, but not in Firefox, however the following url
http://www.guyverdesign.com/new
... works perfectly in firefox but terribly in IE. How do I create an index page that re-directs to http://www.guyverdesign.com if the browser the user has is IE, and to http://www.guyverdesign.com/new if the user has Firefox? I'm sure I've seen this before but my googling has proved fruitless.
Thank you so much for (hopeful) responses!!
http://www.guyverdesign.com
The above url works perfectly in IE, but not in Firefox, however the following url
http://www.guyverdesign.com/new
... works perfectly in firefox but terribly in IE. How do I create an index page that re-directs to http://www.guyverdesign.com if the browser the user has is IE, and to http://www.guyverdesign.com/new if the user has Firefox? I'm sure I've seen this before but my googling has proved fruitless.
Thank you so much for (hopeful) responses!!
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
First off ... superdezign is right in saying fix the problem. Having the different pages for different browsers will cause all kinds of problems later on (especially for maintenance).
Main initial thought is the lack of CSS usage in the page. (Second one by the way is how accessible is this for the disabled ?).
Can you highlight the differences between the two pages so we could try to help. Is it a simple matter of the "tooltip help" when going over an image ? Have you tried the page on Safari (also available on windows) and Opera ?
To answer your question though in case someone else needs it...
get_browser could be used with a header('Location:page');
Main initial thought is the lack of CSS usage in the page. (Second one by the way is how accessible is this for the disabled ?).
Can you highlight the differences between the two pages so we could try to help. Is it a simple matter of the "tooltip help" when going over an image ? Have you tried the page on Safari (also available on windows) and Opera ?
To answer your question though in case someone else needs it...
get_browser could be used with a header('Location:page');
-
shaunguyver
- Forum Newbie
- Posts: 3
- Joined: Wed Aug 15, 2007 8:46 am
Your points are fair, but right now I am simply loking for a way for the user of the two major browsers to get a seemless site.
But of course fixing the problem so that there isn't any need for this get browser function would be better.
In http://www.guyverdesign.com/new the page uses ajax so that the pages load in a given area within the black space at the bottom of the site. In firefox this works fine, in IE it creates an inexplicable margin of about 200px at the bottom of the site.
In http://www.guyverdesign.com the page uses an iframe to load each page but it is set with a 100% width which requires a piece of jacascript in the head to set this. This works fine in IE but in Firefox creates an enormous amount of white space below the site.
So I suppose the real question is - How do I create a function where I can load external html pages into an area that can be 100% the width of the page that works perfectly in both firefox, ie and safari?
And also, your point about disabled users... do you think the text is too small? Or are there other problems?
Shaun Guyver
But of course fixing the problem so that there isn't any need for this get browser function would be better.
In http://www.guyverdesign.com/new the page uses ajax so that the pages load in a given area within the black space at the bottom of the site. In firefox this works fine, in IE it creates an inexplicable margin of about 200px at the bottom of the site.
In http://www.guyverdesign.com the page uses an iframe to load each page but it is set with a 100% width which requires a piece of jacascript in the head to set this. This works fine in IE but in Firefox creates an enormous amount of white space below the site.
So I suppose the real question is - How do I create a function where I can load external html pages into an area that can be 100% the width of the page that works perfectly in both firefox, ie and safari?
And also, your point about disabled users... do you think the text is too small? Or are there other problems?
Shaun Guyver
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Have you looked into Conditional Comments as a possible method of correction for IE ? In your file you could set CSS slightly different for IE. Not sure if this would solve the problem as it depends on how things work in Opera and Safari.shaunguyver wrote: In http://www.guyverdesign.com/new the page uses ajax so that the pages load in a given area within the black space at the bottom of the site. In firefox this works fine, in IE it creates an inexplicable margin of about 200px at the bottom of the site.
CSS and I dread to say some possible CSS Hacks if needed. As it looks from initial brief examination as though you need javascript anyway using AJAX to fill a named div should work.shaunguyver wrote: So I suppose the real question is - How do I create a function where I can load external html pages into an area that can be 100% the width of the page that works perfectly in both firefox, ie and safari?
I am no means an accessibility guru and indeed I am not saying there is anything wrong with the page. Text size initially is not something I think about as CTRL+ in Firefox tends to solve thatshaunguyver wrote: And also, your point about disabled users... do you think the text is too small? Or are there other problems?
You may want to check for simple things with the Total Validator add-on for firefox and see what you get.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Yes there are. The screen readers are free, but to get a voice that isn't annoying to listen to, you have purchase the different voices. I use one that can embed itself into Firefox. The other ones take over the whole computer.CoderGoblin wrote:As far as I know there are no free screen readers available so developers can test applications.
-
shaunguyver
- Forum Newbie
- Posts: 3
- Joined: Wed Aug 15, 2007 8:46 am
http://www.quirksmode.org/css/condcom.html wrote:Conditional comments only work in Explorer on Windows
Code: Select all
<!--[if IE]>
<style type="text/css">@import "inc/style.ie.css";</style>
<![endif]-->- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
Re: Re-direct to one of two urls depending on the browser us
You DON'T!shaunguyver wrote:Hello all. I have a problem -
http://www.guyverdesign.com
The above url works perfectly in IE, but not in Firefox, however the following url
http://www.guyverdesign.com/new
... works perfectly in firefox but terribly in IE. How do I create an index page that re-directs to http://www.guyverdesign.com if the browser the user has is IE, and to http://www.guyverdesign.com/new if the user has Firefox? I'm sure I've seen this before but my googling has proved fruitless.
Thank you so much for (hopeful) responses!!
You create the web site to work on BOTH instead of trying to program the site for specific browser versions by using QUIRKS in each browser. It's not that hard to create a website that works in every browser without coding for specific browsers.
Also, trying to program for different browsers is getting to be useless as most modern browsers can mask their ID to mimic other browsers. So trying to detect for a specific browser is useless. I have been to a few sites that check for Opera and they disable everything if Opera is being used. I just mask as IE and the site magically works. Programming for specific browsers is just plain silly and counter productive. Why counterproductive? Because you end up having to maintain multiple pages for different browsers and that is time consuming and usually the programmer stops maintaining everything but one page for one browser.
Just don't do it and create the site using web STANDARDS so it works on all browsers.
- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
In Opera your NEW page puts a HUGE whitespace at the top of the page the height of the makepovertyhistory.org angle graphic. The original works just fine.shaunguyver wrote:In http://www.guyverdesign.com/new the page uses ajax so that the pages load in a given area within the black space at the bottom of the site. In firefox this works fine, in IE it creates an inexplicable margin of about 200px at the bottom of the site.
- AKA Panama Jack
- Forum Regular
- Posts: 878
- Joined: Mon Nov 14, 2005 4:21 pm
Opera comes with built-in Screen Reader support.superdezign wrote:Yes there are. The screen readers are free, but to get a voice that isn't annoying to listen to, you have purchase the different voices. I use one that can embed itself into Firefox. The other ones take over the whole computer.CoderGoblin wrote:As far as I know there are no free screen readers available so developers can test applications.