Navigation:  Reference > Elements >

Script

Previous pageReturn to chapter overviewNext page

Script is a basic element that can allows you to embed raw Javascript code into the simulation.

You can find the "Script" element in the elements pane, and add it into your page.  It looks like:

Script

Different than other elements, Script element is not visible in HTML5 simulation and exported image/PDF, instead it inserts its content (Javascript code) into the HTML5 simulation.  Here is an example of Script content:

script_code

When you export your plot into HTML5 simulation, the Javascript block will be inserted into the simulation as well.

Remarks: Embedding inappropriate Javascript code into your plot may get unexpected result in the HTML5 simulation. It is better not to do so, unless you have to, and you really know what you are doing.