Yjavascript テスト 新しいページはコチラ
提供: yonewiki
(ページの作成:「<yjavascript> onload = function() { draw1(); }; - →円を描く: function draw1() { var canvas = document.getElementById('c1'); if ( ! canvas || ! canvas.getCont...」) |
|||
| 2行: | 2行: | ||
onload = function() { | onload = function() { | ||
draw1(); | draw1(); | ||
| − | |||
}; | }; | ||
/* 円を描く */ | /* 円を描く */ | ||
function draw1() { | function draw1() { | ||
var canvas = document.getElementById('c1'); | var canvas = document.getElementById('c1'); | ||
| − | if ( ! canvas || ! canvas.getContext ) { return false; } | + | if ((! canvas) ||(! canvas.getContext)) { return false; } |
var ctx = canvas.getContext('2d'); | var ctx = canvas.getContext('2d'); | ||
ctx.beginPath(); | ctx.beginPath(); | ||
| 43行: | 42行: | ||
} | } | ||
</yjavascript> | </yjavascript> | ||
| + | <ycanvas id="c1" width="1098" height="140"></ycanvas> | ||