getContext在谷歌浏览器中,使用时要先加载canvas对象,否则会提示'getContext is null'

<body>
<canvas id="myCanvas" width="" height="" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
<script type="text/javascript">
var c = document.getElementById("myCanvas");
var cxt = c.getContext("2d");
cxt.fillStyle = "#FF0000";
cxt.fillRect(, , , );
</script> </body>
getContext在谷歌浏览器中,使用时要先加载canvas对象,否则会提示'getContext is null'
上一篇:flash上传头像,截取图像 组件演示


下一篇:js笔记——理解js中的call及apply