Results 1 to 2 of 2

Thread: combine scripts

  1. #1
    Join Date
    Aug 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question combine scripts

    G'day
    i was wondering if it is possible to combine these two scripts.
    Style Sheet Switcher
    http://www.dynamicdrive.com/dynamici...etswitcher.htm
    with the
    Browser redirect Script
    http://www.dynamicdrive.com/dynamicindex9/bredirect.htm
    So that i would end up with a script that would redirect the user to a different CSS doc depending on what browser they are using.
    e.g.
    Firefox user is directed to the Firefox CSS doc and vis a versa for IE users

    any help would be appreciated

    regards
    Walshy

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There is a better way, especially when you consider that css style is not javascript and should work even if javascript is disabled. You should set up your styles for FF in one file and link to it first in the head of your page, ex:

    HTML Code:
    <link rel="stylesheet" href="ff_styles.css" type="text/css">
    These ff_styles.css rules will be used for all browsers. Then make up your styles for IE, overriding any of the styles in ff_styles.css if and where need be and including any additional styles that are for IE only. Link them next in the head like so:

    HTML Code:
    <!--[if IE]>
    <link rel="stylesheet" href="ie_styles.css" type="text/css">
    <![endif]-->
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •