Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 15th, 2007, 05:42 AM
Authorized User
Join Date: Jun 2007
Location: Christchurch, , New Zealand.
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hericles
Default Changing stylesheets in FF & IE6

I'm working on a site and am trying to get the stylesheets to automatically detect the browser using javascript and load the correct one. I've done before and its worked but this time I'm having no luck. Despite changing the code around both browsers continue to use the one stylesheet which is causing display problems.
Here's the code:
<link rel="stylesheet" type="text/css" href="style.css" name="ie">
   <link rel="stylesheet" type="text/css" href="style_ff.css" name="ff">
   <script language="javascript">
      var name = navigator.appName;
      if (name == "Netscape")
         document.styleSheets.title = "ff";
      else (name == "Microsoft Internet Explorer")
            document.styleSheets.title = "ie";

Any hints/tps/alternative methods would be appreciated.
Thank you,

"I will prepare and one day my chance will come."
\"I will prepare and one day my chance will come.\"
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i remove active link border in IE & FF? kaos_frack CSS Cascading Style Sheets 5 March 7th, 2007 12:21 PM
about changing dsn & server.mappath liniyer_667 Classic ASP Databases 0 June 12th, 2005 11:18 AM
Changing StyleSheets hugh@kmcnetwork.com Javascript How-To 2 May 18th, 2004 03:40 PM
creation of user & Changing password for existing fathima Classic ASP Components 0 November 12th, 2003 05:13 AM

All times are GMT -4. The time now is 06:42 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.