Line 1: | Line 1: | ||
− | + | window.onload = function () { | |
− | + | creatCanvas(400,400) | |
− | + | ||
− | function | + | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
− | function | + | function creatCanvas(CANVAS_WIDTH,CANVAS_HEIGHT) { |
− | + | document.body.innerHTML = "<canvas id = \"mycanvas\" width=\""+CANVAS_WIDTH+"\" height=\""+CANVAS_HEIGHT+"\"></canvas>" | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } |
Revision as of 15:55, 14 August 2019
window.onload = function () {
creatCanvas(400,400)
}
function creatCanvas(CANVAS_WIDTH,CANVAS_HEIGHT) {
document.body.innerHTML = "<canvas id = \"mycanvas\" width=\""+CANVAS_WIDTH+"\" height=\""+CANVAS_HEIGHT+"\"></canvas>"
}