[html5] r5482 - [e] (0) Explain ononline and onoffline in the author parts. Fixing http://www.w3 [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Sep 24 18:50:03 PDT 2010


Author: ianh
Date: 2010-09-24 18:50:02 -0700 (Fri, 24 Sep 2010)
New Revision: 5482

Modified:
   complete.html
   index
   source
Log:
[e] (0) Explain ononline and onoffline in the author parts.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10415

Modified: complete.html
===================================================================
--- complete.html	2010-09-25 01:12:13 UTC (rev 5481)
+++ complete.html	2010-09-25 01:50:02 UTC (rev 5482)
@@ -63983,6 +63983,9 @@
     (disconnected from the network). Returns true if the user agent
     might be online.</p>
 
+    <p>The events <code title=event-online><a href=#event-online>online</a></code> and <code title=event-offline><a href=#event-offline>offline</a></code> are fired when the value of
+    this attribute changes.</p>
+
    </dd>
 
   </dl><div class=impl>
@@ -64014,8 +64017,30 @@
   <p class=note>This attribute is inherently unreliable. A computer
   can be connected to a network without having Internet access.</p>
 
+  <div class=example>
 
+   <p>In this example, an indicator is updated as the browser goes
+   online and offline.</p>
 
+   <pre><!DOCTYPE HTML>
+<html>
+ <head>
+  <title>Online status</title>
+  <script>
+   function updateIndicator() {
+     document.getElementById('indicator').textContext = navigator.onLine ? 'online' : 'offline';
+   }
+  </script>
+ </head>
+ <body onload="updateIndicator()" ononline="updateIndicator()" onoffline="updateIndicator()">
+  <p>The network is: <span id="indicator">(state unknown)</span>
+ </body>
+</html></pre>
+
+  </div>
+
+
+
   <h2 id=webappapis><span class=secno>7 </span>Web application APIs</h2>
 
   <h3 id=scripting><span class=secno>7.1 </span>Scripting</h3>

Modified: index
===================================================================
--- index	2010-09-25 01:12:13 UTC (rev 5481)
+++ index	2010-09-25 01:50:02 UTC (rev 5482)
@@ -63978,6 +63978,9 @@
     (disconnected from the network). Returns true if the user agent
     might be online.</p>
 
+    <p>The events <code title=event-online><a href=#event-online>online</a></code> and <code title=event-offline><a href=#event-offline>offline</a></code> are fired when the value of
+    this attribute changes.</p>
+
    </dd>
 
   </dl><div class=impl>
@@ -64009,8 +64012,30 @@
   <p class=note>This attribute is inherently unreliable. A computer
   can be connected to a network without having Internet access.</p>
 
+  <div class=example>
 
+   <p>In this example, an indicator is updated as the browser goes
+   online and offline.</p>
 
+   <pre><!DOCTYPE HTML>
+<html>
+ <head>
+  <title>Online status</title>
+  <script>
+   function updateIndicator() {
+     document.getElementById('indicator').textContext = navigator.onLine ? 'online' : 'offline';
+   }
+  </script>
+ </head>
+ <body onload="updateIndicator()" ononline="updateIndicator()" onoffline="updateIndicator()">
+  <p>The network is: <span id="indicator">(state unknown)</span>
+ </body>
+</html></pre>
+
+  </div>
+
+
+
   <h2 id=webappapis><span class=secno>7 </span>Web application APIs</h2>
 
   <h3 id=scripting><span class=secno>7.1 </span>Scripting</h3>

Modified: source
===================================================================
--- source	2010-09-25 01:12:13 UTC (rev 5481)
+++ source	2010-09-25 01:50:02 UTC (rev 5482)
@@ -72438,6 +72438,10 @@
     (disconnected from the network). Returns true if the user agent
     might be online.</p>
 
+    <p>The events <code title="event-online">online</code> and <code
+    title="event-offline">offline</code> are fired when the value of
+    this attribute changes.</p>
+
    </dd>
 
   </dl>
@@ -72475,8 +72479,30 @@
   <p class="note">This attribute is inherently unreliable. A computer
   can be connected to a network without having Internet access.</p>
 
+  <div class="example">
 
+   <p>In this example, an indicator is updated as the browser goes
+   online and offline.</p>
 
+   <pre><!DOCTYPE HTML>
+<html>
+ <head>
+  <title>Online status</title>
+  <script>
+   function updateIndicator() {
+     document.getElementById('indicator').textContext = navigator.onLine ? 'online' : 'offline';
+   }
+  </script>
+ </head>
+ <body onload="updateIndicator()" ononline="updateIndicator()" onoffline="updateIndicator()">
+  <p>The network is: <span id="indicator">(state unknown)</span>
+ </body>
+</html></pre>
+
+  </div>
+
+
+
   <h2 id="webappapis">Web application APIs</h2>
 
   <h3 id="scripting">Scripting</h3>




More information about the Commit-Watchers mailing list