Skip to content

Page Launching Control

thepian edited this page Sep 9, 2012 · 7 revisions

By default the web page will load javascript without any special instructions. You can however change it to depend on deferred scripts, config, login and user properties.

Launch when logged in

If the page connects to a backend and you want to delay the page launching until the connection is established you will need to prevent the default and trigger the launching yourself.

Put the following in your html:

<script>
 Resolver("page").set("state.authenticated",false);
 Resolver("page").on("change","state.loading",function(ev) { 
   if (ev.value == false) ev.preventDefault();
 });
</script>

And then when the connection is established

Resolver("page").set("state.authenticated",true)

Responding to online/offline status

Clone this wiki locally