V
vunet
If I initializer my object as
var obj = new SomeObject();
then I have some method inside of the object as:
function SomeObject(){
.......
this.showLink = function(){
return "<a href='javascript:void(0)' onClick='obj.showMessage()'></
a>"
}
this.showMessage = function(){ alert("My Message is Here") }
.......
}
Obviously, "onClick='obj.showMessage()' " is a wrong refrence because
we may call it obj2 or have multiple objects. How can I reference any
function of an initialized object on click of a link?
Thank you for suggestions.
var obj = new SomeObject();
then I have some method inside of the object as:
function SomeObject(){
.......
this.showLink = function(){
return "<a href='javascript:void(0)' onClick='obj.showMessage()'></
a>"
}
this.showMessage = function(){ alert("My Message is Here") }
.......
}
Obviously, "onClick='obj.showMessage()' " is a wrong refrence because
we may call it obj2 or have multiple objects. How can I reference any
function of an initialized object on click of a link?
Thank you for suggestions.