Results 1 to 2 of 2

Thread: css external js files and browser sniffing

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default css external js files and browser sniffing

    how do I declare and call a function from an external js file so that it loads a specific css file based on a browser that's being used. I want this js file to be used on several pages so an internal script tags shouldn't be used.
    Here's what I want to do.
    Safari is the only browser that supports certain CSS3 styles that I'm using. I want to use a certain stylesheet if Safari is used and if not use the master stylesheet
    Example: version3.css for Safari and master.css for all others

    I'm kind of a beginner to javascript so the simpler the better(I don't want to work with nodes).

  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

    In most cases unsupported style will simply be ignored by those browsers that do not support it. No need to sniff anything.
    Last edited by jscheuer1; 03-27-2010 at 10:28 AM.
    - 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
  •