W3C home > Mailing lists > Public > public-html-diffs@w3.org > September 2010

hixie: Explain ononline and onoffline in the author parts. (whatwg r5482)

From: poot <cvsmail@w3.org>
Date: Sat, 25 Sep 2010 10:50:23 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20100925015023.D5A502BC00@toro.w3.mag.keio.ac.jp>
hixie: Explain ononline and onoffline in the author parts. (whatwg
r5482)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4373&r2=1.4374&f=h
http://html5.org/tools/web-apps-tracker?from=5481&to=5482

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4373
retrieving revision 1.4374
diff -u -d -r1.4373 -r1.4374
--- Overview.html	25 Sep 2010 01:12:18 -0000	1.4373
+++ Overview.html	25 Sep 2010 01:50:06 -0000	1.4374
@@ -46755,6 +46755,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">
@@ -46782,7 +46785,27 @@
   source</a>.</p>
 
   </div><p class="note">This attribute is inherently unreliable. A computer
-  can be connected to a network without having Internet access.<h2 id="webappapis"><span class="secno">6 </span>Web application APIs</h2><h3 id="scripting"><span class="secno">6.1 </span>Scripting</h3><h4 id="introduction-4"><span class="secno">6.1.1 </span>Introduction</h4><p>Various mechanisms can cause author-provided executable code to
+  can be connected to a network without having Internet access.<div class="example">
+
+   <p>In this example, an indicator is updated as the browser goes
+   online and offline.</p>
+
+   <pre>&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+ &lt;head&gt;
+  &lt;title&gt;Online status&lt;/title&gt;
+  &lt;script&gt;
+   function updateIndicator() {
+     document.getElementById('indicator').textContext = navigator.onLine ? 'online' : 'offline';
+   }
+  &lt;/script&gt;
+ &lt;/head&gt;
+ &lt;body onload="updateIndicator()" ononline="updateIndicator()" onoffline="updateIndicator()"&gt;
+  &lt;p&gt;The network is: &lt;span id="indicator"&gt;(state unknown)&lt;/span&gt;
+ &lt;/body&gt;
+&lt;/html&gt;</pre>
+
+  </div><h2 id="webappapis"><span class="secno">6 </span>Web application APIs</h2><h3 id="scripting"><span class="secno">6.1 </span>Scripting</h3><h4 id="introduction-4"><span class="secno">6.1.1 </span>Introduction</h4><p>Various mechanisms can cause author-provided executable code to
   run in the context of a document. These mechanisms include, but are
   probably not limited to:<ul><li>Processing of <code><a href="#script">script</a></code> elements.</li>
Received on Saturday, 25 September 2010 01:51:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:09:10 UTC