Go to page content

script

Execute a Javascript.

This action executes Javascript directly. It can be used to interface with non-Zotonic Javascript libraries and functions.

Example:

{% button title="hello" action={script script="alert('hello world')"} %}

Clicking on the button will show a Javascript alert with the text “hello world” in it.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.