View Full Version : Using Javascript to set Stylesheet based on Browser, not Recognized

10-13-2005, 05:30 PM
I've tried to make a quick Javascript to pick between two Stylesheets depending on what browser is being used. The problem result is that neither Stylesheet is being applied. Can anyone help with what I'm doing incorrectly? Thanks.

<script language="Javascript" script type="text/javascript">
if (navigator.appCodeName=="Mozilla") {
<link rel="stylesheet" type="text/css" href="cis_nie.css" />
else {
<link rel="stylesheet" type="text/css" href="cis.css" />

10-13-2005, 06:51 PM
Is this question not challenging enough or something? :confused:

Single Paradox
10-13-2005, 06:55 PM
no need to use javascript for that ;)

<link rel="stylesheet" href="InternetEX.css" media="all">
<link rel="stylesheet" href="firefox.css" media="screen and all">

10-13-2005, 07:35 PM
Wow! Thanks! I didn't think it would be that easy! How does it select between viewing what is appropriate for varied settings, like UL, which differ in the CSS meant for Firefox versus IE?