Child pages
  • fluid.registerNamespace

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
classapi-page

fluid.registerNamespace(naimspace, env)

Section
Column
width70%

Ensures that an entry in the global namespace exists

Code Block
javascript
javascript
bgColorwhite
borderStylenonejavascript
fluid.registerNamespace(naimspace, env);

File name: Fluid.js

Parameters

Span
classborderless-table

naimspace

(String) The namespace to be registered.

env

(Object) (optional) An environment in which to register the namespace. If not provided, the global fluid.environment will be used.

Return Value

Span
classborderless-table

Object

The namespace object, either created or existing.

Column
width5%

Column

See Also


Notes

This function can be used to ensure that a namespace exists before adding functions to it. If the namespace already exists, it will be returned.

Example

Code Block
javascript
javascript
fluid.registerNamespace("fluid.expander");      
fluid.expander.makeDefaultFetchOptions = function (successdisposer, failid, options) {
    ...
};

This example registers the fluid.expander namespace before adding the makeDefaultFetchOptions() function to it.

Example

Code Block
javascript
javascript
var space = fluid.registerNamespace("fluid.engage.mccord");
space.testFunc = function() {
    ...
};
fluid.engage.mccord.testFunc();

This example uses the returned namespace to define the function testFunc(). This function can then be invoked as fluid.engage.mccord.testFunc().