Offline app capability in HTML5 bought all the power to store data offline .When we talks about offline people ask offline means without internet ? First take the term ONLINE . online and Web are kind of synonyms.
So why the term Offline is getting use for web technology . The ofline here means run the webpage from file:// uri. But hang on it does not mean the web page will never get connected to server.The term offline will make more sense if we will take it like the web page could survive at the server downtime.There are various apps who connects the cloud server and survives at downtime. Gmail Mobile app and gmail offline are examples
.
In the Older time devs used the technique like cookies,Plugin Based Storage for storing data to client side. But the era of HTML5 bought more power to the client side for storage.You can check the application for online/offline using
navigator.onLine().
And it works everywhere in latest browser even in IE also.You can also listen the events for it using.
document.body.addEventListener("online", function () {console.log("Now you are online !!!")}
document.body.addEventListener("offline", function () {console.log("Now you are offline !!!!")}
HTML5 bought many features to make application offline .Few Technique to make app offline
ApplicationCache
Web Storage
Web SQL Database
Indexed database
0 Comment(s)