Old 09-06-2006   #1 (permalink)
Registered User
 
Join Date: Sep 2006
Posts: 5

just a question

Is there a way to load up different pages according the the browser that is used?

my situation is that i have been making my website and viewing it through mozilla firefox. When i looked at my site through IE, it looked different. (ex. some of my CSS commands didnt work) So i would like to run a seperate page depending on the browser being used.

any help would be great
brianblanda is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #2 (permalink)
Recursively call who?
 
GoldNetX's Avatar
 
Join Date: Nov 2003
Location: Pittsburgh, PA
Posts: 294

Send a message via AIM to GoldNetX
There are various ways, and they can be found easily with google. But I would very much so attempt disuade you from using it for the purpose above. You can usually find someway else to code around CSS problems with resorting to multiple pages.
__________________

www.gusmayo.com
- Maybe a story or two -


www.jaloobie.com
... your new home ...

www.webinkproductions.com
- professional web application design -
GoldNetX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #3 (permalink)
Janitor of Lunacy
 
tamlin's Avatar
 
Join Date: May 2006
Location: Sitting in the Wishing Chair
Posts: 4,940

I agree totally with GoldNetX - you should write one piece of code and write it properly rather than try to "code round" different browsers. You could write different blocks of code for Firefox and IE, but what if your visitors are using Opera or Safari or even something like Lynx? Are you going to attempt to write separate code blocks for every possible browser?
__________________


Religion: It's all fun and games until someone gets burned at the stake...
tamlin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #4 (permalink)
Naruto Express
 
allstar's Avatar
 
Join Date: May 2006
Location: Scotland
Posts: 69

Send a message via AIM to allstar Send a message via MSN to allstar
Well all you have to do is stick to codes that work in both browsers or have your site coded for the two main broswers.
__________________
allstar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #5 (permalink)
Janitor of Lunacy
 
tamlin's Avatar
 
Join Date: May 2006
Location: Sitting in the Wishing Chair
Posts: 4,940

Quote:
Originally Posted by brianblanda View Post
some of my CSS commands didnt work
Any chance of seeing the code that doesn't work? Maybe we can fix it.
__________________


Religion: It's all fun and games until someone gets burned at the stake...
tamlin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #6 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 43

I agree with all above msg-s, good webmaster could be able to make one code which would work for all browsers.

Answer of your question is

Code:
<script language="JavaScript" 
type="text/JavaScript">
if(navigator.appName == "WebTV")
{
 window.location = "WebTVHome.html"
}
 if(navigator.appName == "Netscape")
{
 window.location = "NetscapeHome.html"
}
 if(navigator.appName == "Microsoft Internet Explorer")
{
 window.location = "ExplorerHome.html"
}
 window.location == "Other.html"
</script>
metsatöll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #7 (permalink)
Registered User
 
Join Date: Sep 2006
Posts: 27

Metsatoll, what if one person have IE 4 and other IE 5 or IE6? Your code does not give him any solution
You need to have a script (server side) that will ask server to identify yours client browser. End after this step you have to redirect user (he will not know that ) to use another CSS file. This is the only correct way but this asks for a little bit of programing.
zlatiborac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #8 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 43

@zlatiborac, I totaly agree with the all things you said. Actually I would prefer to use one CSS which would work fine with all browsers and to use different CSS files just as different themes for the site

I didnt check if the javascript works fine or not, I took it from .........

But it works fine with ie5.5+
metsatöll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-06-2006   #9 (permalink)
Registered User
 
Join Date: Sep 2006
Posts: 27

No, your script is OK but it would not determine what version of browser is on the client comp
I'll agree with you that the best way is to put everything in one CSS file, do the hacks in it and call additional CSS files if and when needed.
It's not so hard to determine what browser is installed on client comp using PHP, just google a little bit if you need that. It is by the far the best solution but it also need PHP skills
zlatiborac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-07-2006   #10 (permalink)
Intermediate User
 
Neil_8_24_93's Avatar
 
Join Date: May 2006
Posts: 96

Send a message via AIM to Neil_8_24_93 Send a message via MSN to Neil_8_24_93
I have been having the same problem....my CSS commands work properly in one browser and then in another its all messed up.
Neil_8_24_93 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-08-2006   #11 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 43

CSS codes works very different between mozilla, safari, opera, internet explorer. If you already know CSS codes well, then you should also study CSS-Hacks aswell.

For example,
width : 100px
* width : 110px
first value will be accepted by firefox in css and second one (* width) will be ignored but internet explorer will see * sign and it will use that one and IE would ignore width
metsatöll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-12-2006   #12 (permalink)
Registered User
 
Alex McKee's Avatar
 
Join Date: May 2006
Posts: 28

Start with validating your document. Use modern flavours of HTML, use a doctype etc.

Hacking is not recommended. Use Conditional Comments to feed IE a different/additional stylesheet. The other browsers commonly in use are all well within the accepted margin for error and therefore just focus on getting the main styleshee to work with standards compliant methods.
Alex McKee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-13-2006   #13 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 43

Quote:
Originally Posted by Alex McKee View Post
Hacking is not recommended. Use Conditional Comments to feed IE a different/additional stylesheet.
?? I didnt get it, since when and why css hacks are not recomendded?
metsatöll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-13-2006   #14 (permalink)
Registered User
 
Alex McKee's Avatar
 
Join Date: May 2006
Posts: 28

Quote:
Originally Posted by metsatöll View Post
?? I didnt get it, since when and why css hacks are not recomendded?
When Microsoft developed IE7 they fixed most of the CSS bugs that allow the hacks to work. So pages that rely on hacks will fail in IE7. The use of conditional comments was officially requested by Microsoft's IE team and I agree with them.
Alex McKee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-14-2006   #15 (permalink)
Registered User
 
Join Date: Sep 2006
Posts: 27

I agree with you but what I'm going to do with cca. 70% of user who are still on IE 6, 5.5, 5 and Good forbid IE4???
zlatiborac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Mangament System Question LimitLess HTML / PHP / ASP / JS 3 06-01-2006 12:32 AM
.PSD File Size Question Pho3niX Adobe Photoshop 10 04-27-2006 06:50 PM
Question regarding Layers cybermule Illustration, Sketching & Vector Art 3 02-09-2006 07:08 PM
New here, forgive the question Xsavior Photography & Photo Manipulation 2 12-30-2005 06:37 PM
PHP Syntax question BlodoPKNZ HTML / PHP / ASP / JS 9 08-08-2004 09:58 PM


All times are GMT +1. The time now is 07:40 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2007 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT