#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Northern California
    Posts
    2
    Rep Power
    0

    Detecting browsers that do not support CSS


    Hello,

    I'm working on a site with a very complex layout, lots of pics and rollovers, etc. I have always used tables to achieve the positioning and layout of the page, but the time has come to give that up and use CSS layers to do the site's look. I want to use javascript to detect older browsers that don't support CSS, and redirect users to an alternative no-CSS version of my site.

    My question is what is the best way to use javascript to detect css support in a browser?

    if( /* no css support */ )
    {
    //redirect them to the no-css site
    }
    else
    {
    //let em through
    }
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Northern California
    Posts
    2
    Rep Power
    0
    <script>
    if (document.all || document.layers || document.getElementById){
    document.write("<LINK REL="StyleSheet" HREF="" type="text/css">");
    <!--Support CSS-->
    }else{
    document.write("<LINK REL="StyleSheet" HREF="" type="text/css">")
    <!--Non CSS Browser-->
    }
    </script>

    i found this on google what do you guys think?

IMN logo majestic logo threadwatch logo seochat tools logo