I'm currently doing the following to give my javascript code a namespace:
(function(foo, $, undefined) {
// function: showNoteDialog
foo.showNoteDialog = function() {
// ...
}
}(window.foo = window.foo || {}, jQuery));
What I would prefer is instead of:
foo.showNoteDialog()
Is to have a multiple level namespace:
foo.notes.showDialog()
foo.other.showDialog()
Is this possible? How would I do this?
There aren't namespaces in JS, but you can assign objects to other objects like