Tuesday, January 31, 2012

Check if the browser support canvas, using Javascript

Check if the browser support canvas, using Javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mobile-Web-App: Javascript Exercise</title>
<script type="text/javascript">
function checkcanvas(){
if(document.createElement('canvas').getContext){
alert("Very Nice! Your browser support canvas:)");
}else{
alert("Sorry! your browser doesn't support Canvas");
}
}

</script>
</head>
<body onload="checkcanvas();">
<h1>Mobile-Web-App: Javascript Exercise - Check Canvas</h1>

</body>
</html>


No comments:

Post a Comment