Run JavaScript
Extend the capabilities of your SOTI Snap app with custom actions. Use the Run JavaScript action to add custom JavaScript code to your app and define new and complex actions for events.
Run JavaScript actions are added to SOTI Snap apps like any other action: on a widget, add an event and then select Run JavaScript from the Actions dropdown list. Then, you can paste valid, well-formed JavaScript code or edit code directly in the Script Editor.
SOTI Snap validates your JavaScript as you type. Click the warning or error messages on the left of the script editor to see the issues. Although SOTI Snap lets you save invalid JavaScript code, the script will not work in the app.
JavaScript APIs
You can augment your custom JavaScript actions by embedding SOTI Snap objects and functions directly within your scripts.
While in the JavaScript text editor, type Snap.
(capital 'S',
period included) and then hold down Control +
Space to trigger a list of SOTI Snap APIs.
You can also use native JavaScript DOM APIs or jQuery-based APIs to interact with SOTI Snap widgets, but we recommend using SOTI Snap JavaScript APIs wherever possible.