You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

includeJs()

Usage

Structr.includeJs(filename)

Description
Searches for a JavaScript library file and if found, inserts the content of this file into the current JavaScript context.
A file can be marked as JavaScript library in the property dialog of the file.

fig

Note

This function is only available in JavaScript contexts.

Example

${{
    Structr.includeJs("functions.js");

    includedFunction('test');
}}

Search results for "includeJs()"

Built-in Properties

Using the Structr Built-in Function includeJs() you can include a javascript library into a scripting environment, allowing you to access the defined functions and variables. For this to work, however, the Use As Javascript Libarary flag of the included file has to be set.