Created
September 11, 2012 09:03
-
-
Save jameshibbard/3697077 to your computer and use it in GitHub Desktop.
Check if HTML5 canvas element is supported
This file contains 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
function isCanvasSupported(){ | |
var elem = document.createElement('canvas'); | |
return !!(elem.getContext && elem.getContext('2d')); | |
} | |
$(document).ready(function() { | |
if(isCanvasSupported()){ | |
alert("Yay!"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment