Live update

Monkey Targets Forums/HTML5/Live update

Bilbo(Posted 2016) [#1]
Hi Guys

Is there any way of having a live update for the HTML.While the browser is open.


rIKmAN(Posted 2016) [#2]
What do you mean by "live update"?


skid(Posted 2016) [#3]
If you want to disconnect your users from some database and get them to log back in it is simplest to refresh the window.location variable in the DOM.

This should cause a refresh cycle to the browser that should include your server noticing modified files and serving fresh new editions. If caching is an issue I would start using unique names for the .js scripts and modify the html files to point to new scripts. The benefit here is you can rewind an upgrade easily if you botched something.


TeaBoy(Posted 2016) [#4]
AJAX?


Paul - Taiphoz(Posted 2016) [#5]
the problem with sending a refresh skid is that it will load EVERYTHING again and not just the things that have changed, so projects with a lot of assets would not be updated live as the OP is asking for.


skid(Posted 2016) [#6]
The OP asked for the browser to stay open not for the monkey game script to remain running. Yes, after the user is told they need to hit OK the app restart will have to load everything but most content will be cached by HTTP protocol. A good game will save and restore it's state so that the entire cycle could appear pretty seamless.