W
webgour
Hello,
I would like to create an onload event within my object.
The following works fine :
function TEST()
{
this.image= new Image();
}
TEST.prototype.Initialize = function()
{
var _this = this;
this.image.onload = function(){_this.Alerting("Image Loaded");};
this.image.src = "winxp.gif";
}
TEST.prototype.Alerting = function(i_string){alert(i_string);}
var mTest = new TEST();
mTest.Initialize();
mTest.image.attachEvent("onload",function(){alert("Load event access from
page");},false);
But i would rather be able to use :
mTest.attachEvent("onload",function(){alert("Load event access from
page");},false);
and therefore create an event listener within my object rather than use the
image.onload event listener.
Thank you for your time.
I would like to create an onload event within my object.
The following works fine :
function TEST()
{
this.image= new Image();
}
TEST.prototype.Initialize = function()
{
var _this = this;
this.image.onload = function(){_this.Alerting("Image Loaded");};
this.image.src = "winxp.gif";
}
TEST.prototype.Alerting = function(i_string){alert(i_string);}
var mTest = new TEST();
mTest.Initialize();
mTest.image.attachEvent("onload",function(){alert("Load event access from
page");},false);
But i would rather be able to use :
mTest.attachEvent("onload",function(){alert("Load event access from
page");},false);
and therefore create an event listener within my object rather than use the
image.onload event listener.
Thank you for your time.