# j-Unsaved

> j-Unsaved: easy usage

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: c6c487e3540c6881efb177ac6b9492de5d9b7d3a0e88696b99a4dbdcd253678a
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- `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.

```html 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>
```
