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:
- http
- JavaScript
- file
- ftp: download/upload files
- mailto
- news
- gopher
To create a reaction that runs JavaScript:
- Choose Interaction > Reactions > Call JavaScript.
- Enter the JavaScript that you want to run and click OK.
- Link the reaction to a sensor.
- 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