External JavaScript module functions.

It might be preferable for security reasons and modularity to keep all your functions in a single JavaScript module file instead of embedding them in a HTML page. This way you can also use a debugger within the external functions.

It is possible to gather multiple functions in a single JavaScript module file which makes them available in XPath expressions. Optionally a prefix can be specified to avoid conflicts with other function libraries.

The module library can be found at ./lib.js. Visit it!

Loading a libary of JavaScript module functions.

Loading a libary of prefixed functions.

The prefix can be used to avoid conflicts with other function libraries.

Reusing function libraries (module)

Making an application with multiple pages or nested Fore elements? No worry, you can reuse the same fx-functionlib without overwriting function definitions. If in conflict the XPath engine always uses the first matching function definition.

In the example below 2 function libraries are used. The second also contains theanswer() but that version is ignored. It also contributes now().

Another library is loaded additionally and can be found at ./lib2.js. Visit it!