check internet availability on web code example Example: Check for internet availability on web online = window.navigator.onLine;