Glavin001 / SMMApp2

Saint Mary's Mobile App, Version 2.0 @
http://society.cs.smu.ca:7000
2 stars 0 forks source link

Detect Internet / if Online #48

Open Glavin001 opened 10 years ago

Glavin001 commented 10 years ago

http://stackoverflow.com/a/2384227/2578205 Or http://stackoverflow.com/a/9786599/2578205 Or http://remysharp.com/2011/04/19/broken-offline-support/

Danlock commented 10 years ago

what exactly needs to be done once we detect that the app is offline? w e can just integrate checking of the navigator.Online method, but since the browser takes care of loading from cache.... i put a check for navigator in home.js however

Glavin001 commented 10 years ago

Yeah, there isn't too much valuable in it since most everything else is cached.

What is not, is realtime data, and I wanted it to popup message when either disconnected or offline.

We could use Socket.io's connection_failed and disconnect events for that instead? https://github.com/LearnBoost/socket.io/wiki/Exposed-events