无法加载资源(Javascript image.src)

时间:2013-02-22 16:25:37

标签: javascript loadimage

我想问你下面我的代码有什么问题:

var myCanvas = document.getElementById('myCanvas');
var ctx = myCanvas.getContext('2d');

var image = new Image();
image.onload = onLoad;
image.src = './PS_Countdown.jpeg';
ctx.drawImage(image, 25, 25);

function onLoad() {
    console.log('Image loaded');
}

0 个答案:

没有答案