Good question!
Firstly, your JavaScript is a little bit wrong. To achieve the effect that I think you need, your first namespace should look like this:
var NAMESPACE_FIRST = { init: function() { alert("onload functions"); }, map: function() { this.length = 0; NAMESPACE_FIRST.map.prototype.build = function() { alert("1"); return this.length; } } }
So, answering question 2, your onready will look something like this:
$(function () { NAMESPACE_FIRST.init(); var obj = new NAMESPACE_FIRST.map(); obj.build(); }
Regarding question 1, I have no real opinion anyway.
source share