bob.ns Namespace (bob.js JavaScript Framework)


bob.ns namespace defines functionality related to registering and extending JavaScript namespaces.


setNs - function

setNs(ns [, extension])


Registers new, or extends existing JavaScript namespace with given extension object's members.



ns - string defining namespace name. Use period (.) to separate nested namespace name parts (e.g. 'bob.collections.extensions').

extension - (optional) JavaScript object containing members (functions and fields) that will be copied under a newly created namespace. If this parameter is missing, empty namespace will be created.



bob.ns.setNs('myApp.myMethods', {
method1: function() {
 console.log('This is method 1');
method2: function() {
 console.log('This is method 2');
//call method1.
//call method2.

See Also

bob.js on CodePlex.

JavaScript namespaces via bob.js.

Last edited Oct 11, 2012 at 12:59 PM by ttutisani, version 2


No comments yet.