i am trying to create a abstract class (mimicking oops) in js using below declaration. If i use prototype keyword for every method below it fails (see case-1 below) however when i use without prototype keyword it works not sure am i declaring it correclty.. however same declaration works when js file is declared to the main page but fails when invoke from dialog box.. i think declaration is issue
if(nsp === undefined) var nsp = {}; // nsp is the namespace
nsp.abstractCls= function(){} ; //abstractCls is the abstract function & subclass function will extend perfAction methods (overriden methods)
nsp.abstractCls.prototype ={};
//case-1 fails , throws error is not a function (prototype keyword is present)
nsp.abstractCls.prototype.perfActiOn = function(){
return "success";
} ;
//case-2 this works (no prototype keyword)
nsp.abstractCls.perfActiOn = function(){
return "success";
} ;
Statment nsp.abstractTbl.prototype.perfTable wroks but not sure is it correct approach to have prototype keyword to invoke every function..