Jan
3
2011
3
2011
html 5 detecteren
Dit is een soort van “hello world” voorbeeld ![]()
Mijn eerst HTML5 test met de addEventListeren, just build right in there! Fantastisch!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Canvas tester</title>
<style type="text/css">
#cnvs {
border: solid 1px #666;
width: 600px;
height: 600px;
}
</style>
<script>
function initCanvasHTML5() {
try {
var cnvs = document.getElementById('cnvs').getContext('2d');
cnvs.translate(-10, 350);
cnvs.beginPath();
cnvs.moveTo(0, 0);
cnvs.quadraticCurveTo(310, -250, 410, -250);
cnvs.lineWidth = 1;
cnvs.stroke();
//document.body.innerHTML = 'HTML5 supported';
} catch(e) {
document.body.innerHTML = 'HTML5 not supported, reason: ' e;
}
}
window.addEventListener("load", initCanvasHTML5, true);
</script>
</head>
<body id="htmlBody">
<canvas id="cnvs" class="canvas"></canvas>
</body>
</html>
Tags: html
Reageer
Code Library
- Apache en .htaccess (6)
- HTML en CSS (4)
- Javascript (26)
- MySQL (14)
- PHP (27)
- Zend Framework (1)
Tags
Nu online
- 0 Members.
- 6 Guests.

Een artikel door Willem




