Home / Admin / hascustomvariable.js
Duplicate Snippet

Embed Snippet on Your Site

hascustomvariable.js

Code Preview
html
<script type="text/javascript">
	document.addEventListener('om.Dtr.init', function(event) {
		/**
		 * API method for checking if a custom variable has been registered.
		 * Must be accessed via the Dtr object.
		 *
		 * @param string $key The custom variable key to check.
		 * @return bool       True if the custom variable exists, false otherwise.
		 */
		event.detail.Dtr.hasCustomVariable('foo');
	});
</script>

Comments

Add a Comment