- From: poot <cvsmail@w3.org>
- Date: Sat, 25 Sep 2010 10:50:23 +0900 (JST)
- To: public-html-diffs@w3.org
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><!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">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