I'm using the following format to avoid possible naming conflicts. My main aim is to keep the parts of the program in different files during development and then later combine it Editor is the
main.js
Editor=function(){
this.manage=function(){
}
}
var editor= new Editor;
a.js
Editor.prototype.A=function(){
this.afunct=function(){
}
}
b.js
Editor.prototype.B=function(){
var this.var1;
var this.var2;
this.bfunct=function(){
//call afunct() here
}
}
A is a set of functions that does some testing,modification etc. afunct is a tester function which needs to be used in all the other files. B is supposed to act as a data package and new instances of it will be created to pass around.
How will I call afunct inside bfunct? Please help me understand how I can do this. Thank You in advance.
PS. I'm kind of a newbie in Javascript and please pardon any flaw in my logic.