Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-04-2004, 01:42 PM   PM User | #1
finstah1
Regular Coder

 
Join Date: May 2004
Location: The First State
Posts: 233
Thanks: 9
Thanked 0 Times in 0 Posts
finstah1 is an unknown quantity at this point
AOL specific style sheet script

Hi all,

I currently have a script that loads a style sheet based on browser (IE,NN) and platform (PC, Mac). My question is, is there a way to detect if someone is using an AOL browser to have the page load a style sheet specific to AOL?

thanks in advance
finstah1 is offline   Reply With Quote
Old 06-04-2004, 01:51 PM   PM User | #2
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
check out the user-agent string of the browser. if it has AOL in it, then you can create a stylesheet for it!

something like...

Code:
if (navigator.userAgent.indexOf("AOL") != -1) alert("is AOL") ;
hope that helps
jbot is offline   Reply With Quote
Old 06-04-2004, 04:20 PM   PM User | #3
finstah1
Regular Coder

 
Join Date: May 2004
Location: The First State
Posts: 233
Thanks: 9
Thanked 0 Times in 0 Posts
finstah1 is an unknown quantity at this point
perfect. It works great! Thanks for your help
finstah1 is offline   Reply With Quote
Old 07-21-2004, 08:39 PM   PM User | #4
finstah1
Regular Coder

 
Join Date: May 2004
Location: The First State
Posts: 233
Thanks: 9
Thanked 0 Times in 0 Posts
finstah1 is an unknown quantity at this point
Is it possible to also use navigator.appName for AOL? Is there a benefit of one over the other?

I keep getting issues with some AOL users not being able to read the text (i.e. too small to read)

I don't understand this, I am using the browser detection script above to point to the old style sheet so that AOL can view the pages. It works for some of the people having issues, but not others so my thinking is that userAgent tag is prohibiting them from viewing the correct style sheet?
I thought is was disabled javascript but that was not the case.

This is sooooo damn frustrating as I can not for the life of me duplicate this problem (I've tested AOL 4, 7, 8, and 9)

Could it be an AOL thing?

please help!

thanks
finstah
finstah1 is offline   Reply With Quote
Old 07-21-2004, 09:51 PM   PM User | #5
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
i don't think appName will reveal anymore information about AOL, for the simple reason that AOL is based on other browsers. this is perhaps the source of your problem, since some versions of AOL use IE and others Netscape. you'll probably have to use a mixture of userAgent and object detection.

yes, it's frustrating, but it's really just a case of experimenting and reitierating the process till you've got it as good as possible. it'll never be perfect, all you can do is make it the best for as many people as possible without sacrificing too much.
jbot is offline   Reply With Quote
Old 07-22-2004, 01:53 PM   PM User | #6
finstah1
Regular Coder

 
Join Date: May 2004
Location: The First State
Posts: 233
Thanks: 9
Thanked 0 Times in 0 Posts
finstah1 is an unknown quantity at this point
here's what I have. I've created a style sheet using em and % for fonts that renders correctly on these:

PC:
NN 4.79, 7.02,
Mozilla 1.6, 1.7
IE 5.5, 6
Opera 7.11, 7.5
Firefox 0.9

Mac:
IE 5.2, 5.2.2
NN 4.77, 4.79, 6.22, 7.02, 7.1
Mozilla 1.6
Opera 7.5
Safari 1.0, 1.2
Firefox 0.7, 0.8
OmniWeb 4.5
Camino 0.7

Linux:
Mozilla 1.6
Firefox

The problem with too small text is coming from a few AOL users regardless of browsers. Because there are so many variables involved with each users machine, it's hard to pinpoint what the problem is. When I test AOL (v. 4,7,8,9) here at work on win95, win98, win2000 and winXP, I can't duplicate the problem, my script works here.

Somehow I think it's something with their current configuration. Oh well, I'll spend a little more time on it before we decide to live with it.

Last edited by finstah1; 07-22-2004 at 01:56 PM..
finstah1 is offline   Reply With Quote
Old 07-22-2004, 02:50 PM   PM User | #7
finstah1
Regular Coder

 
Join Date: May 2004
Location: The First State
Posts: 233
Thanks: 9
Thanked 0 Times in 0 Posts
finstah1 is an unknown quantity at this point
this is what I came up with. Hopefully it will work.

((navigator.userAgent.indexOf("AOL") != -1) && (document.getElementById || document.all || document.layers))
finstah1 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 03:38 PM.


Advertisement
Log in to turn off these ads.