ForgeComponents
en

Components

j-OneTime

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

This component executes a method only once and it waits for expiration.

Configuration:

  • required exec {String} a path to the method that will be executed
  • expire {String} expiration, default 1 year
  • delay {Number} a delay for executing method in milliseconds, default: 1000 ms

Use it with <ui-component name="onetime">. 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="onetime" config="exec:onetimealert;expire:1 month"></ui-component>

<script>

	function onetimealert() {
		alert('After a month, this message will appear again.');
	}

</script>