I have a javascript class person, I have made Obj of it, works fine. But I need to access the function from person class.
When I tried to access I get ..not a function error.
Please help!
Important... I need to initialize the 'person' class, and call the method exactly same way of my code. How?? Help!
Here is my code:
var person = {
setBasic: function(data) {
alert(data.name + ' ' + data.age);
},
this:getPerson = function() {
alert('get me');
},
success: null
};
//lets instantiate.enter code here
var perObj = new person.setBasic({ 'name': 'ikair', 'age': 33, });
// works fine..
//now I need to call a function of person class:
perObj.getPerson();
//not working :(... how to call function with prev code?