Navigator onLine Property

Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
Navigator onLine Property
❮ Navigator Object
Example
Find out whether the browser is online:
var x = "Is the browser online? " + navigator.onLine;
<!--
The result of x will be:
document.write("Is the browser online? " + navigator.onLine);
-->Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The onLine property returns a Boolean value that specifies whether the
browser is in online or offline mode.
Note: This property is read-only.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| onLine | 14.0 | Yes | 3.5 | 5.0.4 | Yes |
Syntax
navigator.onLine<!--
mid_content, all: [300,250][336,280][728,90][970,250][970,90][320,50][468,60]-->
Technical Details
| Return Value: | A Boolean, indicating whether the browser is in online or offline mode. Returns true if the browser is online, otherwise it returns false |
|---|
More Examples
Example
A demonstration of all navigator properties in one example:
var txt = "";
txt += "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt += "<p>Browser Name: " + navigator.appName + "</p>";
txt += "<p>Browser Version: " + navigator.appVersion + "</p>";
txt += "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt += "<p>Browser Language: " + navigator.language + "</p>";
txt += "<p>Browser Online: " + navigator.onLine + "</p>";
txt += "<p>Platform: " + navigator.platform + "</p>";
txt += "<p>User-agent header: " + navigator.userAgent + "</p>";Try it Yourself »
❮ Navigator Object