Documentation

Plugins/Claypool/register

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Plugins/Claypool

register( context, prioty )

Register the context to be searchable.
Claypool uses this internally to create the application context, though there may be a need in some applications to add session context or request context, etc. A context is simply access to objects managed by the framework. Using contexts is cleaner and safer than storage in global scope.
Arguments:
contextObject
An object that implements Claypool.AbstractContext
priotyNumber
If 0, the context will overwrite the built in application context, otherwise the context is added and will be searched in order of registration.


Examples:
Registers a custom context (in this made up example the CookieContext may load all values stored as cookies so we can access them as $.$("foo");

$.register(MyApp.CookieContext, 1);

NameType