2009/dap/system-info battery-status.html,1.1,1.2

Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv6715

Modified Files:
	battery-status.html 
Log Message:
Refined the one-shot example

Index: battery-status.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/battery-status.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- battery-status.html	5 Apr 2011 16:19:12 -0000	1.1
+++ battery-status.html	6 Apr 2011 15:06:18 -0000	1.2
@@ -217,16 +217,13 @@
       </p>
       <div class='example'>
         <pre class='sh_javascript'>
-function handler(event) {
+var handler = function (event) {
   console.log(event.level);
+  window.removeEventListener('batterystatus', handler, true);
 }
 
 window.addEventListener('batterystatus', handler, true);
-window.removeEventListener('batterystatus', handler, true);
         </pre>
-        <p class='note'>
-          The event may be dispatched multiple times in the above example.
-        </p>
       </div>
     </section>
     

Received on Wednesday, 6 April 2011 15:06:22 UTC