私は次のコードを持っています:
function createImage(source) {
var pastedImage = new Image();
pastedImage.onload = function() {
}
pastedImage.src = source;
}
この関数createImage
には、画像のソースを含むソースパラメータが含まれています。その後、pastedImage
クラスのオブジェクトを作成し、のImage
ようなhtml画像要素オブジェクトを取得していることを警告した後[object HTMLImageElement]
。
私の質問は、そのオブジェクトを使用してHTMLページに画像を表示する方法です。機能後に表示したいonload
。