Open Tuinslak opened 12 years ago
You could use navigator.onLine
and/or the offline
and online
events for this.
E.g. use an interval (setInterval
) to do the hard refresh, and reschedule it in case navigator.onLine
is false
.
Has this been solved @segersjens ?
@segersjens this isn't fixed: http://botmaster.corp.flatturtle.com/tmp/2012-04-07-141725_1920x1080_scrot.png
We had a 1-2 hours internet issue. NMBS stations gives an error and doesn't fetch new data anymore after internet connectivity is back up.
Same is true for Google maps (compare screenshots after browser restart: http://botmaster.corp.flatturtle.com/tmp/2012-04-07-142414_1920x1080_scrot.png)
We need to device to do a hard refresh once every X hours (to pull website updates):
but in case of a loss of internet connectivity (for whatever reason), browser should keep trying every X seconds.
Can we fix this with JS?
get JS to pull new content/html/(and data), and keep working even if there is no internet connectivity at some point ? Prevent a DNS error page on browser