Fix an HTML issue.
authorMounir Lamouri <mounir.lamouri@gmail.com>
Mon, 05 Nov 2012 16:43:41 +0000
changeset 270 5af8a0637294
parent 269 20ab51fe20f3
child 271 60e739325ffd
Fix an HTML issue.
network-api/Overview.html
--- a/network-api/Overview.html	Mon Nov 05 16:39:27 2012 +0000
+++ b/network-api/Overview.html	Mon Nov 05 16:43:41 2012 +0000
@@ -238,60 +238,56 @@
       <p>
         This trivial example writes the connection bandwidth to the console and shows it again each time it is changing:
       </p>
-      <div class="example">
-        <pre class="example highlight">
-          function show() {
-            console.log(navigator.connection.bandwidth);
-          }
+      <pre class="example highlight">
+        function show() {
+          console.log(navigator.connection.bandwidth);
+        }
 
-          navigator.connection.addEventListener('change', show, false);
+        navigator.connection.addEventListener('change', show, false);
 
-          show();
-        </pre>
-      </div>
+        show();
+      </pre>
 
       <p>
         This example shows how an application can prevent automatic polling using the metered attribute:
       </p>
-      <div class="example">
-        <pre class="example highlight">
-          &lt;!DOCTYPE html&gt;
-          &lt;html&gt;
-            &lt;head&gt;
-              &lt;title&gt;Conditional polling&lt;/title&gt;
-              &lt;script&gt;
-                var gPreviousMetered = navigator.connection.metered;
-                var gIntervalId;
+      <pre class="example highlight">
+        &lt;!DOCTYPE html&gt;
+        &lt;html&gt;
+          &lt;head&gt;
+            &lt;title&gt;Conditional polling&lt;/title&gt;
+            &lt;script&gt;
+              var gPreviousMetered = navigator.connection.metered;
+              var gIntervalId;
 
-                function poll() {
-                  // poll stuff
+              function poll() {
+                // poll stuff
+              }
+
+              navigator.connection.addEventListener('change', function() {
+                if (gPreviousMetered == navigator.connection.metered) {
+                  return;
                 }
 
-                navigator.connection.addEventListener('change', function() {
-                  if (gPreviousMetered == navigator.connection.metered) {
-                    return;
-                  }
+                gPreviousMetered = navigator.connection.metered;
+                if (navigator.connection.metered) {
+                  gIntervalId = setInterval(poll, 1000);
+                } else {
+                  clearInterval(gIntervalId);
+                }
+              }, false);
 
-                  gPreviousMetered = navigator.connection.metered;
-                  if (navigator.connection.metered) {
-                    gIntervalId = setInterval(poll, 1000);
-                  } else {
-                    clearInterval(gIntervalId);
-                  }
-                }, false);
-
-                // At load time.
-                if (!navigator.connection.metered) {
-                  gIntervalId = setInterval(poll, 1000);
-                }
-              &lt;/script&gt;
-            &lt;/head&gt;
-            &lt;body&gt;
-              &lt;button onclick="poll();"&gt;Poll&lt;/button&gt;
-            &lt;/body&gt;
-          &lt;/html&gt;
-        </pre>
-      </div>
+              // At load time.
+              if (!navigator.connection.metered) {
+                gIntervalId = setInterval(poll, 1000);
+              }
+            &lt;/script&gt;
+          &lt;/head&gt;
+          &lt;body&gt;
+            &lt;button onclick="poll();"&gt;Poll&lt;/button&gt;
+          &lt;/body&gt;
+        &lt;/html&gt;
+      </pre>
     </section>
 
     <section class='appendix'>