Introduction
JavaScript is a powerful programming language that enables you to add and extend functionality already built into Discover. Custom JavaScript is only available to users with active subscriptions.
Numerous online resources are available to guide you in mastering JavaScript and implementing the desired changes to your surveys.
To add JavaScript to your survey, navigate to the Custom JavaScript section in the Settings tab.
Discover’s survey runtime is a single-page application. This means that the browser sends the initial request for the page, but all subsequent navigation and rendering is handled in the browser via JavaScript. Due to the nature of this paradigm, any custom JavaScript added to your survey will only be executed on the initial page load when the respondent navigates to your survey URL unless you use Discover’s built-in system hooks.
In your JavaScript, you can use defined variables and built-in scripting functions to retrieve data, responses, and other useful metadata.