1
Objekt.prototype.loadImg = function(pImg){
if(pImg!=null){
this.imgLoaded=false;
this.img = null;
this.img = new Image();
this.img.src = pImg;
this.img.onload = function(){
alert("!");
this.autoSize();
this.imgLoaded=true;
};
}
}
我的问题是“this”在“onload = function()”函数中无效!Javascript图像onload callback class-intern函数
alert(“!”);被执行,但不是Objekt.prototype.autoSize() - 例如函数!
我需要做些什么来调用我的“class-intern”函数(例如autoSize)?
完美!非常感谢你! – user1511417 2012-07-09 09:04:13