Created
November 22, 2012 02:17
-
-
Save shabith/4129070 to your computer and use it in GitHub Desktop.
Check for HTML5 support in browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment