首页上一页 1 下一页尾页 1 条记录 1/1页
画布代码哪里写错了,帮忙看下,打开后浏览器不显示矩形。
发表在其他语言图书答疑区
2016-11-16
是否精华
是
否
版块置顶:
是
否
画布代码哪里写错了,帮忙看下,写完后打开浏览器没有显示矩形
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="textcml; charset=gb2312" />
<title>无标题文档</title>
<script>
function draw(id){
var canvas= document.getelementbyid(id);
if (convas==null)
return false;
var context =canvas.getContext('2d');
contexte.fillstyle= "blue ";
context.fillrect(0,0,400,300);
context.fillstyle="grenn";
context.stokestye="red";
context.linekestyle=1;
context.fillrect.(50,50,100,100)
contexe.strokret.(50,50,100,100)}
</script>
</head>
<body onload=draw('canvas');">
<h1>canvas</h1>
<canvas id="canvas" width="400" height="300"/>
</body>
<cml>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="textcml; charset=gb2312" />
<title>无标题文档</title>
<script>
function draw(id){
var canvas= document.getelementbyid(id);
if (convas==null)
return false;
var context =canvas.getContext('2d');
contexte.fillstyle= "blue ";
context.fillrect(0,0,400,300);
context.fillstyle="grenn";
context.stokestye="red";
context.linekestyle=1;
context.fillrect.(50,50,100,100)
contexe.strokret.(50,50,100,100)}
</script>
</head>
<body onload=draw('canvas');">
<h1>canvas</h1>
<canvas id="canvas" width="400" height="300"/>
</body>
<cml>