Wednesday, 15 August 2012

As promised the skeleton code for the HTML5 Canvas detection


Due to time constraints in class I could not wait for everyone to take this down, so as promised, here is the skeleton code for the HTML5 Canvas detection. Please note: 1) I am expecting you to expand on this code and to communicate the browser's possible lack of capabilities clearly to your user.
2) You need to make sure to reference your Modernizr that you downloaded as it might be a different version and have a different path!

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HTML5 capability detections</title>
<script type="text/javascript" src="js/modernizr.custom.78490.js"></script>
</head>
<body>
<noscript>
Sorry, but you need JavaScript enabled!
</noscript>
<script type="text/javascript">
if (Modernizr.canvas) {
alert("Canvas ready");
} else {
alert("no Canvas support");
}
</script>
</body>
</html>

No comments:

Post a Comment