Visit Mozilla.org

DOM:window.navigator.onLine

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Returns a boolean value indicating whether the browser is online or not.

[edit] Syntax

online = window.navigator.onLine;
  • online is a boolean true or false.

[edit] Example

alert(navigator.onLine ? "You're online" : "You're offline");

[edit] Notes

See Online/Offline Events‎ for a more detailed description of this property as well as new offline-related features introduced in Firefox 3.

[edit] Specification

DOM Level 0. Not part of any standard.

Described in the HTML 5 Working draft