Jaxer.Includer : Object
Return to: Jaxer Framework index

Namespace object holding functions and members used to get and include HTML and JavaScript from external sources.

Platform Support

Jaxer Server FrameworkJaxer Client Framework
1.0no

Functions

MethodActionJaxer Server FrameworkJaxer Client Framework
static compile(String contents, [Object global,] [String effectiveUrl]) : String
Compile the given JavaScript string in the given global context

(Advanced)
Show Details1.0no

Parameters
StringcontentsThe string of script code to compile
Objectglobal(optional)An optional global context (usually a window object) in which to compile it
StringeffectiveUrl(optional)An optional parameter to indicate (e.g. in error messages) the effective URL from which this code originates.

Returns
StringThe compiled bytecode, as a string.

static evalCompiledOn(String contents, [Object global]) : Object
Evaluate the given JavaScript bytecode string in the given global context

(Advanced)
Show Details1.0no

Parameters
StringcontentsThe string of script code to evaluate
Objectglobal(optional)An optional global context (usually a window object) in which to evaluate it

Returns
ObjectThe result of the last JavaScript expression evaluated.

static evalOn(String contents, [Object global,] [String effectiveUrl]) : Object
Evaluate the given JavaScript string in the given global context

(Advanced)
Show Details1.0no

Parameters
StringcontentsThe string of script code to evaluate
Objectglobal(optional)An optional global context (usually a window object) in which to evaluate it
StringeffectiveUrl(optional)An optional parameter to indicate (e.g. in error messages) the effective URL from which this code originates.

Returns
ObjectThe result of the last JavaScript expression evaluated.

static load(String src, [Object global,] [String runat,] [Boolean useCache,] [Boolean forceCacheRefresh,] [Boolean dontSetRunat]) : Object
Loads and evaluates a JavaScript file on the given global execution object with the given runat attribute.
Show Details1.0no

Parameters
StringsrcThe 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.
Objectglobal(optional)The global (usually a window object) on which to evaluate it. By default, it is the same global as the one in which the calling function is executing.
Stringrunat(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.
BooleanuseCache(optional)If true, the file is loaded from a cached compiled version if available, and if not available the file's contents are fetched, compiled and cached. By default this is false.
BooleanforceCacheRefresh(optional)If true, force loading from src even if found in cache. The loaded contents will then be cached. By default this is false.
BooleandontSetRunat(optional)If true, any functions created in this script block will not have a runat property set on them, not even the default runat of the last script block. By default this is false.

Returns
ObjectThe result of the last JavaScript expression evaluated, if any.

aptana_docs