http://jsfiddle.net/totszwai/WvbPn/2/
function DialogBox() {
this.__DEBUGGING__ = false;
DialogBox.debug = function (b) {
this.__DEBUGGING__ = b;
};
DialogBox.test = function (b) {
alert("hello worodl");
};
};
$(document).ready(function () {
dialogbox = new DialogBox();
dialogbox.test();
});
I can't figure out what I did wrong in there. I tried it with
DialogBox.prototype.test
DialogBox.test
test
I am trying to make it so that when calling its own function internally, I don't need to put this
all the time... example: this.test()
UPDATE: Also is there a way to not type "this" everywhere when calling private function? Normally I just write simple global function that is for one time use, but now I'm trying to write something different, and that I will be calling these private function all over the place within my class. So I am trying to just avoid using "this" everywhere... not to mention it makes the code readability pretty bad.
Like for example in Java (not JS), you don't need to type "this" everywhere.