Skip to content

Instantly share code, notes, and snippets.

@shabith
Created November 22, 2012 02:17
Show Gist options
  • Select an option

  • Save shabith/4129070 to your computer and use it in GitHub Desktop.

Select an option

Save shabith/4129070 to your computer and use it in GitHub Desktop.

Revisions

  1. shabith created this gist Nov 22, 2012.
    18 changes: 18 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    /**
    * Assume we want to check the placeholder HTML5 feature support in input element.
    * Credit should go to Daniel Stocks, I found this on his placeholder plugin
    * (https://github.com/danielstocks/jQuery-Placeholder/blob/master/jquery.placeholder.js#L71)
    */

    var NATIVE_SUPPORT = !!("placeholder" in document.createElement( "input" ));

    /**
    * Assume we want to check for HTML5 cavas support.
    * Found it on the stackoverflow. http://stackoverflow.com/a/2746983/502748
    *
    */

    function isCanvasSupported(){
    var elem = document.createElement('canvas');
    return !!(elem.getContext && elem.getContext('2d'));
    }