Snippet – Checking Internet Connection, No More Hanging App
When you are writing your single page application (SPA) may find that you need to check your connection. The idea is that you might have one set of logic for your connected app and another for when you are disconnected.
In previous posts, AppCache for Offline Apps and Loading, Caching LoDash or Underscore Templates Using RequireJS, AppCache, you learned that your Web app did not have to be online to be run. In fact, when building HTML apps for mobile devices, you are running without a connection.
So how do you check? How do you know when you can upload and download new information from the Web?
Many of the comments on StackOverflow have to do with the connection hanging. The following snippets help you work around the issue.
Continue reading “Snippet – Checking Internet Connection, No More Hanging App”