<!doctype html>
<html>
<head>
<title>Canvas test</title>
</head>
<body>
<script type="text/javascript">
c = getElementById('canvas');
ctx = c.getContext("2d")'
ctx.fillRect(10,10,10,10);
</script>
<canvas id="canvas" height ="100" width = "100"></canvas>
</body>
</html>
我已經在Chrome和IE 9上試過了,它們都沒有顯示任何東西。你知道爲什麼不工作?爲什麼不顯示此HTML5畫布?
這可能是一些愚蠢的事情,我的朋友要求我張貼這個,因爲他懶得註冊,但我自己弄不明白。