How to run a JS function after DOM is complete && server connect is done?

You are probably correct.

Here’s an update…

Add a toggle element named dom_loaded to the layout.

Add this javascript that will check the toggle when the DOM is loaded:

  window.addEventListener('DOMContentLoaded', (event) => {

    dmx.parse("dom_loaded.check()")
  });

Change the while condition to also make sure the toggle is checked:

2 Likes