Space TimelineSpace Timeline

Widget onExit event handler

This event handler is used to save widget data or warn the user the data will not be saved, when the user leaves the widget (changes the URL of the browser tab). The event handler is not called when the user closes the tab or the entire browser window - instead, the browser-defined warning prompt will be shown. Along with standard widget-level variables, and additional '$continue' function available in event handler code.

Name Type

Return type

Description

Name Type

Return type

Description

`$continue()`

none

continues the navigation to new URL

Example

The following onExit event handler will always show a confirmation prompt when the user leaves the widget.

var navigationConfirmed = prompt('Any unsaved data will be lost. Continue?') if (navigationConfirmed) { $continue() }