126
rated 0 times
[
128]
[
2]
/ answers: 1 / hits: 24451
/ 10 Years ago, tue, june 24, 2014, 12:00:00
I am trying to use OOP based javascript/jQuery. I want to put all my JS function inside a class, so it can be easily overridden/hooked.
I tried with a simple OOP code, but its giving type error: not a constructor.
Please have a look at my code and guide me what is wrong in my code, and how to fix it.
var myTestClass = {
testAttribute : 'test', // atttribute
testMethod : function(){ alert( testAttribute); }
};
var my = new myTestClass();
my.testMethod();
Thanks
More From » jquery