my problem seems to be that my object function is not visible if i call it from within an object of functions. Example Code:
function foo()
{
this.bar = function()
{
alert("hit me!");
}
this.sna = {
fu: function ()
{
this.bar();
}
};
}
this seems to refer to sna instead of foo. How do i adress foo? this.parent does not work.
thisand scoping in javascript - it's a too wide topic to be explained in a short answer on SObarusingthiswhen you called your method by….sna.fu.bar(), as it does reference…sna.fu.