[html5] r8325 - [e] (0) Add another <output> example Affected topics: HTML

whatwg at whatwg.org whatwg at whatwg.org
Mon Dec 2 16:25:28 PST 2013


Author: ianh
Date: 2013-12-02 16:25:27 -0800 (Mon, 02 Dec 2013)
New Revision: 8325

Modified:
   complete.html
   index
   source
Log:
[e] (0) Add another <output> example
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2013-12-03 00:05:50 UTC (rev 8324)
+++ complete.html	2013-12-03 00:25:27 UTC (rev 8325)
@@ -45428,13 +45428,28 @@
    <pre><form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
  <input name=a type=number step=any> +
  <input name=b type=number step=any> =
- <output name=o></output>
+ <output name=o for="a b"></output>
 </form></pre>
 
   </div>
 
+  <div class=example>
 
+   <p>In this example, an <code><a href=#the-output-element>output</a></code> element is used to report the results from a remote
+   server, as they come in:</p>
 
+   <pre><output id="result"></output>
+<script>
+ var primeSource = new WebSocket('ws://primes.example.net/');
+ primeSource.onmessage = function (event) {
+   document.getElementById('result').value = event.data;
+ }
+</script></pre>
+
+  </div>
+
+
+
   <h4 id=the-progress-element><span class=secno>4.10.14 </span>The <dfn><code>progress</code></dfn> element</h4>
 
   <dl class=element><dt><a href=#element-dfn-categories title=element-dfn-categories>Categories</a>:</dt>

Modified: index
===================================================================
--- index	2013-12-03 00:05:50 UTC (rev 8324)
+++ index	2013-12-03 00:25:27 UTC (rev 8325)
@@ -45428,13 +45428,28 @@
    <pre><form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
  <input name=a type=number step=any> +
  <input name=b type=number step=any> =
- <output name=o></output>
+ <output name=o for="a b"></output>
 </form></pre>
 
   </div>
 
+  <div class=example>
 
+   <p>In this example, an <code><a href=#the-output-element>output</a></code> element is used to report the results from a remote
+   server, as they come in:</p>
 
+   <pre><output id="result"></output>
+<script>
+ var primeSource = new WebSocket('ws://primes.example.net/');
+ primeSource.onmessage = function (event) {
+   document.getElementById('result').value = event.data;
+ }
+</script></pre>
+
+  </div>
+
+
+
   <h4 id=the-progress-element><span class=secno>4.10.14 </span>The <dfn><code>progress</code></dfn> element</h4>
 
   <dl class=element><dt><a href=#element-dfn-categories title=element-dfn-categories>Categories</a>:</dt>

Modified: source
===================================================================
--- source	2013-12-03 00:05:50 UTC (rev 8324)
+++ source	2013-12-03 00:25:27 UTC (rev 8325)
@@ -49773,13 +49773,28 @@
    <pre><form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
  <input name=a type=number step=any> +
  <input name=b type=number step=any> =
- <output name=o></output>
+ <output name=o for="a b"></output>
 </form></pre>
 
   </div>
 
+  <div class="example">
 
+   <p>In this example, an <code>output</code> element is used to report the results from a remote
+   server, as they come in:</p>
 
+   <pre><output id="result"></output>
+<script>
+ var primeSource = new WebSocket('ws://primes.example.net/');
+ primeSource.onmessage = function (event) {
+   document.getElementById('result').value = event.data;
+ }
+</script></pre>
+
+  </div>
+
+
+
   <h4>The <dfn><code>progress</code></dfn> element</h4>
 
   <dl class="element">




More information about the Commit-Watchers mailing list