ForgeComponents
en

Components

j-Unsaved

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • path optional, can contain a link to the Boolean value, true will display a confirmation message

Configuration:

  • check {String} a link to the check function() { that must return Boolean -> true will 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.

example.html
<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>