j-Unsaved
pathoptional, can contain a link to theBooleanvalue,truewill display a confirmation message
Configuration:
check {String}a link to the checkfunction() {that must returnBoolean->truewill display a confirmation message (it's synchronous)message {String}a message for the user (it may not work with most browsers because they have their own messages)
Use it with <ui-component name="unsaved">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="unsaved" config="check:checkunsaved"></ui-component>
<script>
function checkunsaved() {
// if "true" then the browser will ask about unsaved changes
return true;
}
</script>