Kod
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="de.css" />
<script src="js/custom.js"></script>
</head>
<body>
dawdwadwd
<canvas id="draw" width="500" height="300">
Wyświetli to jak canvas nie działa
</canvas>
</body>
</html>
<html>
<head>
<link rel="stylesheet" href="de.css" />
<script src="js/custom.js"></script>
</head>
<body>
dawdwadwd
<canvas id="draw" width="500" height="300">
Wyświetli to jak canvas nie działa
</canvas>
</body>
</html>
Kod
var canvas = document.getElementById('canvas');
if (canvas.getContext){
var c = canvas.getContext('2d');
c.beginPath();
c.moveTo(35, 10);
c.lineTo(60, 40);
c.lineTo(10, 40);
c.lineTo(35, 10);
c.stroke();
c.fillText('a',30,60);
c.fillText('c',110,60);
c.fillText('b',70,130);
}
if (canvas.getContext){
var c = canvas.getContext('2d');
c.beginPath();
c.moveTo(35, 10);
c.lineTo(60, 40);
c.lineTo(10, 40);
c.lineTo(35, 10);
c.stroke();
c.fillText('a',30,60);
c.fillText('c',110,60);
c.fillText('b',70,130);
}