Click to See Complete Forum and Search --> : netscape + dynamically assigned stylesheet definitions?


Yoghurt
10-14-2003, 09:02 AM
Hello there,
I am trying to make a browser/screen friendly javascript application.
I want my program to work like this:

1)program determines which browser is the user using and redirects him to specified site. (explorer vs. netscape)

2)On this site, there is a stylesheet definition (external file) and script that determines user's screen resolution and accordingly changes the stylesheet's definition.
<link rel="stylesheet" type="text/css" href="" id="style" /> is the definition.

3)The script uses this construction: style.href="aaa.css". This seems to work flawlessly in IE, but does not work in Netscape. I wonder if there is a way how to accomplish this.

(I know there is a way...make different XHTML file for each resolution, but that somehow does not attract me...)

Therefore, I was wondering if you could help me with this!

PS:sorry for English related mistakes!

gil davis
10-14-2003, 01:31 PM
You did not specify what version of Netscape. It sounds like you are trying to make this work on NS 4. If so, I would suggest that you make the LINK point to the Netscape file and if you detect IE, then change the style.href.