Online or Offline | JavaScriptSource

Online or Offline

JavaScriptSource Staff May 11, 2007


By checking the documents current location a script can determine if you are on or offline because the document's location will be different when online. This can be useful for an Intranet, redirecting the user to a local file if they are offline.


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: onlineOffline.js


Paste this code into the HEAD section of your HTML document.

Leave a Response