there is some way to do this?
function test()
{
this.write = function(text)
{
alert(text);
}
this.read = function()
{
this.write('foo');
// WRONG WAY
// test.write('foo');
}
}
How can i call the “this.write” function from “this.read”?
EDIT:
Found the awnser by EricG. Have tried with the code above and it works. But my real code still not working. I’ve to figure out what’s happening.
The Way to call “THIS.WRITE” from inside “THIS.READ” is just by calling ‘this.write()”. Just like that.
Thanks!
jsFiddle