SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2010
    0 Post(s)
    0 Thread(s)

    JS Browser Check?

    So, I'm looking for a JS code that will check the current browser and then use a different background image accordingly.

    Mainly for browsers like Flock and etc. that aren't yet CSS3 friendly (background-size:cover; etc.)

    I'm not looking for an alternative to CSS3, because, well, I like it! Just a way to check if the current browser is CSS3 friendly.


    I just started reading an article about Object Detection ( Seems like a better alternative to browser detection. However, how do I use JS to check if the browser supports a CSS3 statement???


    Okay so now I've found some JS that detects css3/html5 capabilities ( My only problem is I need some help figuring out how to use the JS. I'm very new to JS!

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Melbourne, AU
    17 Post(s)
    1 Thread(s)
    First you need to go to and save the contents as a .js file as you will need mootools in order for this detection script to work.

    Next you will need to also save the contents of as a .js file then do the following...

    NOTE: Only the options in the
    List of CSS3/HTML5 feature tests

    can be used. Anything else not in the list will return undefined.

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="" dir="ltr" lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>CSS3 Tester</title>
    <script type="text/javascript" src="mootools-1.2.4-core-yc.js"></script>
    <script type="text/javascript" src="mooModernizr-min.js"></script>
    <script type="text/javascript">


Posting Permissions

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