Steps to Initialise Live Updates with JS
Initialising Live Updates with the Object Constructor in JavaScript
1) Include the JS
{% if context.exports.sitebuilder.live_update_JS_loaded == blank %}
<script async src="{{'modules/module_86/js/v1-6/sitegurus_live_update_javascript_api.min.js' | asset_url }}"></script>
{% assign live_update_JS_loaded = true %}
{% export live_update_JS_loaded, namespace: sitebuilder %}
{% endif %}
2) Add an event-listener to watch for the Script to load
<script>
//The live-update module's script is loaded asynchronously, so you must wait for it to be ready before using its functions.
document.addEventListener('live_update_script_ready', ready);
function ready() {
}
</script>
3) Passing in the Public Key and Initialising
4) Add an HTML control and attach an Event Listener
5) Trigger a Live Update when the Event Callback runs
Last updated
Was this helpful?

