The following site only works if you are offline. Link
So how do they do this?
I have even seen Youtube do something similar. just open YouTube and disconnect net and refresh. You will see the page below.
HTML5 allows webpages to work offline by;
localStorage
and sessionStorage
.navigation.onLine
property is a boolean which lets you know whether you're online or not.So basically, both pages store the assets it needs to work offline in either of those storage mediums, and checks whether it's online or offline when the page loads.
For more info, you could see http://www.html5rocks.com/en/features/offline
EDIT: Meh, infact the site you linked to works by downloading the flash content, and then pinging http://images.desimartini.com/allaboutrajni/config.xml
every second to detect whether it's still connected to the internet. This website won't load if you disconnect and then refresh the page.
However, a page which uses true offline functionality is one such as http://htmlfive.appspot.com/static/stickies.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With