# Jaxer.CoreEvents : Object
Return to: Jaxer Framework index

A namespace object holding functions and members used to handle the events fired from the Jaxer Core into the Jaxer Framework.

## Platform Support

Jaxer Server Framework | Jaxer Client Framework
--- | ---
1.0 | no

## Functions

Method | Action | Jaxer Server Framework | Jaxer Client Framework
--- | --- | --- | ---
static addHandler(String eventType, Function handlerFunction, [Function testFunction,] [Object handlerFunctionObject]) : void Bind a handler to the specified eventType. (Advanced) | Show Details | 1.0 | no

Parameters

String | eventType | One of the allowed event types (see Jaxer.CoreEvents.getEventNames)
Function | handlerFunction | A function reference invoked when the event specified by eventType is triggered
Function | testFunction | (optional)An optional function to be evaluated when the event is about to be fired; it'll only be fired if the function evaluates to true. The one argument passed to this function is the request (same as Jaxer.request)
Object | handlerFunctionObject | (optional)Optional object on which to call the handlerFunction (it becomes the value of 'this' within the function).

static clearHandlers(String eventType) : void Removes the handlers for the specified eventType. (Advanced) | Show Details | 1.0 | no

Parameters

String | eventType | One of the allowed event types (see Jaxer.CoreEvents.getEventNames)

static fire(String eventType) : void Triggers the handlers for the specified eventType. (Advanced) | Show Details | 1.0 | no

Parameters

String | eventType | One of the allowed event types (see Jaxer.CoreEvents.getEventNames)

static getEventNames() : Array Returns a (copy of the) array of framework event names to which you can register handlers (Advanced) | Show Details | 1.0 | no

Returns

Array | n array of handler names (modifying it has no impact on CoreEvents)

static getHandlers(String eventType) : Array Returns an array of handlers for the specified eventType. (Advanced) | Show Details | 1.0 | no

Parameters

String | eventType | One of the allowed event types (see Jaxer.CoreEvents.getEventNames)

Returns

Array | An array of handlers

static isScriptEvaluateEnabled(Object scriptElement) : Boolean
Should the given script element be evaluated (server-side) by Jaxer Core rather than be handled separately by the Jaxer framework or be ignored by Jaxer as far as evaluation goes. Note that if the script element has a src attribute then the framework will inline a call to load the script from the src, and that's why this method returns a true in that case.
(Advanced)

Show Details

1.0

no

Parameters

Object | scriptElement | The DOM script element

Returns

Boolean | true if it should be evaluated, false if it should not

static isScriptLoadEnabled(Object scriptElement) : Boolean Should the given script element be loaded and evaluated (server-side) by the Jaxer framework (Advanced) | Show Details | 1.0 | no

Parameters

Object | scriptElement | The DOM script element

Returns

Boolean | true if it should be loaded and valuated, false if it should not

static removeHandler(String eventType, Function handlerFunction) : void Remove an existing handler on an event type (Advanced) | Show Details | 1.0 | no

Parameters

String | eventType | One of the allowed event types (see Jaxer.CoreEvents.getEventNames)
Function | handlerFunction | The handler to remove

aptana_docs