returnValue property
The returnValue
property of the
BeforeUnloadEvent interface, when set to a truthy value, triggers a
browser-generated confirmation dialog asking users to confirm if they
really want to leave the page when they try to close or reload it, or
navigate somewhere else. This is intended to help prevent loss of unsaved
data.
Note:
returnValue
is a legacy feature, and best practice is to trigger the dialog by invoking Event.preventDefault on theBeforeUnloadEvent
object, while also settingreturnValue
to support legacy cases. See theWindow.beforeunload_event
event reference for detailed up-to-date guidance.
Implementation
external String get returnValue;
Implementation
external set returnValue(String value);