Previous Document Next Document

Interaction > Creating reactions > Call JavaScript reaction

Call JavaScript reaction


This reaction calls a JavaScript when launched. To call a JavaScript function, the function has to be defined in the host web page or be a standard one. For example, alert(message) is a standard method of JavaScript window object, as long as myOnClick()is a function defined in your host web page, you can type: alert("Hello") or myOnClick()

The JavaScript and Hyperlink reactions support all types of URLs, including:

To create a reaction that runs JavaScript:
  1. Choose Interaction > Reactions > Call JavaScript.
  2. Enter the JavaScript that you want to run and click OK.
  3. Link the reaction to a sensor.
  4. To test the reaction, publish a host web page. When the reaction is launched, the browser executes the JavaScript.

Call JavaScript Reaction Parameters

URL

The JavaScript to run when the reaction is launched.


See also:

Publishing your 3D content

Linking Sensors and Reactions

Editing Triggers

Previous Document Next Document