我有以下代码:
function createImage(source) {
var pastedImage = new Image();
pastedImage.onload = function() {
}
pastedImage.src = source;
}
该函数createImage包含包含图像来源的源参数。之后,我创建了pastedImage类的对象,Image并提醒我正在获取 html 图像元素对象,例如[object HTMLImageElement].
我的问题是如何使用该对象将图像显示到我的 html 页面中。我想在onload函数之后显示它。