I have a large js file that I want to break into multiple namespaces.
Is this a good/bad approach vs keeping everything in one namespace?
In NAMESPACE_FIRST how do I call map build?
var NAMESPACE_FIRST = { init:function() { alert("onload functions"); }, this.map:function() { this.length = 0; }, this.map.prototype.build:function(){ return this.length; } }; var NAMESPACE_SECOND = { upload:function() { //do something }, delete:function() { //do something } }; $(function () { NAMESPACE_FIRST.init(); });