Jaxer : Object
Return to: Jaxer Framework index

The Jaxer namespace.

Platform Support

Jaxer Server Framework Jaxer Client Framework
1.0 1.0

Properties

Property Action Jaxer Server Framework Jaxer Client Framework
static lastScriptRunat : String
The value of the runat attribute of the last script block encountered.

(Advanced)
No Details 1.0 no
Visibility
advanced
static pageWindow : ChromeWindow
This is the global execution context for JavaScript code you define in (or load into) a page on the server. It's aliased as window in the page, so it behaves just like the window global object on the client (browser).

(Advanced)
No Details 1.0 no
Visibility
advanced
static application : Object
A persistent session-like container that can store and persist name-value pairs in the context of an entire application. Whether a given page belongs to a given application is determined by configApps.js, usually from the page's URL. All pages belonging to an application, and their callbacks, have read/write access to this application container, regardless of user session, and to no other application-level container.
No Details 1.0 no
static buildNumber : String
This property exposes the current build number of the Jaxer engine
No Details 1.0 no
static clientData : Object
A JavaScript Object that can be used to communicate data from the server at the end of server-side page processing to the client. When Jaxer starts to process a page server-side, Jaxer.clientData is an empty object: { } . If you set any properties on this object, the entire object will be JSON-serialized at the end of server-side processing, and will be automatically de-serialized when it gets to the client, so you can access your data as Jaxer.clientData in the browser. Note that if there is no data, Jaxer.clientData will not be created at all on the client.
No Details 1.0 no
static corePreferences : Object
This gives read-only access to the Jaxer Core's preferences, each of which become a property on this object.
No Details 1.0 no
static embeddedClientFramework : String
If Jaxer.Config.EMBEDDED_CLIENT_FRAMEWORK_SRC has been set, it's assumed to be the path to the embeddable (and usually compressed) version of the Jaxer client-side framework. This file is read once at server startup and kept in memory, to be embedded in pages that may require it. You can change this behavior using Jaxer.Response.prototype.setClientFramework.
No Details 1.0 no
static isCallback : Boolean
True when Jaxer is processing a callback request, false otherwise.
No Details 1.0 no
static isOnServer : Boolean
True on the server side, false on the client (browser).
No Details 1.0 1.0
static page : Object
A persistent session-like container that can store and persist name-value pairs in the context of one page. What constitutes a page is defined by configApps.js, usually from the page's URL (i.e. it determines which URLs constitute unique pages). A page and its callbacks have read/write access to this page container regardless of user session, and to no other page-level container.
No Details 1.0 no
static proxies : Array<Function>
Adding functions (or their names) to this array is equivalent to setting their proxy property to true. To enforce no proxies, overriding any proxy property or runat="server-proxy", set Jaxer.proxies = null.
No Details 1.0 no
static request : Jaxer.Request
Contains information and methods about the current request
No Details 1.0 no
static response : Jaxer.Response
Contains information and methods about how to respond to the current request
No Details 1.0 no
static responseErrorPage : String
If Jaxer.Config.RESPONSE_ERROR_PAGE has been set, it's assumed to be the path to a file containing the error page to return when an error has occurred during the response. This file is read once at server startup and kept in memory, to be returned as required. If Config.RESPONSE_ERROR_PAGE is not set, a default HTML string is used. You can change the behavior of the framework when it encounters errors serving requests using Jaxer.Config.DISPLAY_ERRORS.
No Details 1.0 no
static session : Object
A persistent session container that can store and persist name-value pairs in the context of a user/browser session across all pages of an application. What constitutes an application is defined by configApps.js, usually from the request's URL. A page and its callbacks have read/write access to this page container regardless of user session, and to no other page-level container.
No Details 1.0 no
static sessionPage : Object
A persistent session-like container that can store and persist name-value pairs in the context of a user/browser session on a given page. What constitutes a page is defined by configApps.js, usually from the request's URL. A page and its callbacks have read/write access to this sessionPage container as long as the session continues, and to no other sessionPage containers.
No Details 1.0 no

Functions

Method Action Jaxer Server Framework Jaxer Client Framework
static include(String url, [Object global]) : void
Loads and evaluates JavaScript from the given location against the given global execution context. This is a low-level wrapper around "@mozilla.org/moz/jssubscript-loader;1" and mozIJSSubScriptLoader.loadSubScript. It's best to use the higher-level Jaxer.Includer.load(src, global, runat) which is also conveniently available as Jaxer.load(src, global, runat) inside any Jaxer server-side page (where global is defaulted to window).

(Advanced)
Show Details 1.0 no

Parameters
String url The url of the file to include, either as an absolute URL in the form "file:///..." or relative to the current executable's folder (with or without the "resource:///" prefix.
Object global (optional)An optional global context in which to evaluate the script.

static notifyFatal(Object error) : void
Notifies the framework that a fatal error has occurred, one which will require fixing and restarting Jaxer. How this is handled is then determined by the Jaxer.Config settings.

(Advanced)
Show Details 1.0 no

Parameters
Object error The error describing what happened. If the framework has already been notified of an error, this error is not used.

static load(String src, [Object global,] [String runat]) : void
Loads a JavaScript file and evaluates it.
Show Details 1.0 no

Parameters
String src The URL from which the JavaScript file should be retrieved. If the src is an absolute file://... URL then it is retrieved directly from the file system, otherwise it is retrieved via a web request.
Object global (optional)The global (usually a window object) on which to evaluate it. By default, it is the current window object of the page.
String runat (optional)The value of the effective runat "attribute" to use when evaluating this code. By default, it uses the same runat attribute as the last evaluated script block.

static loadAllExtensions() : void
Loads all extensions from the folder defined in Config.EXTENSIONS_DIR.
No Details 1.0 no
static loadExtension(String name, Object namespaceObject) : void
Loads a framework extension (already defined in memory). If the namespaceObject defines an onLoad method, it will be called (without arguments)
Show Details 1.0 no

Parameters
String name The (unique) name to use for this extension
Object namespaceObject The object holding all the members of this extension

static Server() : void
Holds the proxy functions for calling server functions that were designated with runat="both-proxy" (or equivalent), to prevent function name collisions. So e.g. if a function getName() is defined with runat="both-proxy", in the browser you can call getName() to use the client-side function or Jaxer.Server.getName() to use the server-side function. Jaxer.Server holds both the synchronous and asynchronous versions of the proxies (e.g. Jaxer.Server.getName() and Jaxer.Server.getName.async()).
No Details no 1.0
static setEvent(Object domElement, String eventName, Object handler) : void
Used to set events on DOM elements such that they "do the right thing" both client-side and server-side. On the client, this acts as expected, setting a property with the name eventName (e.g. onclick) on the DOM element. On the server, the eventName attribute is set on the DOM element so it can be serialized with the DOM before sending to the client. If the handler is a (server side) function with a name, the attribute's value is handler.name + "()" On the server,
Show Details 1.0 1.0

Parameters
Object domElement The element on which to set the event
String eventName The name of the event to set
Object handler The handler function, or the body (as a string)

static setTitle(String title) : void
Sets the title of the document and works on either the server or the client.
Show Details 1.0 1.0

Parameters
String title The text of the title

static unloadExtension(String name, Boolean noWarnings) : void
Unloads a previously-loaded framework extension. If its namespaceObject defines an onUnload method, it will be called (without arguments)
Show Details 1.0 no

Parameters
String name The name used to load this extension
Boolean noWarnings Whether to warn if the extension was not loaded when this was called, or its namespaceObject was not there.

aptana_docs