I want to check if internet is available or not when the web page loads. I want to do this in order to:
- disable like buttons request if offline, during development
- load local links if no network, otherwise load from HTTP
- call more data from server in appcache based offline apps only if user is online
How do I achieve this?