标签:javascrip etc 对象 提示 null getc var idt support
<body> <canvas id="myCanvas" width="200" height="100" 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(0, 0, 150, 75); </script> </body>
getContext在谷歌浏览器中,使用时要先加载canvas对象,否则会提示‘getContext is null‘
getContext在谷歌浏览器中,使用时要先加载canvas对象,否则会提示'getContext is null'
标签:javascrip etc 对象 提示 null getc var idt support
原文地址:http://www.cnblogs.com/LLMjiayou7/p/6377610.html