I want to find out how to get variable name associated in object declaration. Easier to describe this problem is by an example, so:
function MyObject (){
this.NeedToKnow = "";
this.getLink = function() {
html = '<a href="javascipt:' +this.NeedToKnow+'.doIt(passVal) ">M</a>';
return html;
}
this.doIt = function(passVal) {
//do stuff
}
}
varNeedToKnow = new MyObject ();
var html = varNeedToKnow .getLink();
So my question is, how to find out "varNeedToKnow" to fill this.NeedToKnow inside object?
Is it even possible?