[html5] r3866 - [e] (0) Fix example now that Storage is no longer string-based.

whatwg at whatwg.org whatwg at whatwg.org
Tue Sep 15 17:15:54 PDT 2009


Author: ianh
Date: 2009-09-15 17:15:54 -0700 (Tue, 15 Sep 2009)
New Revision: 3866

Modified:
   source
Log:
[e] (0) Fix example now that Storage is no longer string-based.

Modified: source
===================================================================
--- source	2009-09-16 00:12:29 UTC (rev 3865)
+++ source	2009-09-16 00:15:54 UTC (rev 3866)
@@ -62213,24 +62213,16 @@
 <script>
   if (!localStorage.pageLoadCount)
     localStorage.pageLoadCount = 0;
-  localStorage.pageLoadCount = parseInt(localStorage.pageLoadCount, 10) + 1;
+  localStorage.pageLoadCount += 1;
   document.getElementById('count').textContent = localStorage.pageLoadCount;
 </script></pre>
 
-   <p>The use of <code title="">parseInt()</code> is needed when
-   dealing with numbers (integers in this case) because the storage
-   APIs are all string-based.</p>
-
   </div>
 
   <p>Each site has its own separate storage area.</p>
 
-  <p>Storage areas (both session storage and local storage) store
-  strings. To store structured data in a storage area, you must first
-  convert it to a string.</p>
 
 
-
   <!--BOILERPLATE middle-w3c-api-intro-->
   <!--BOILERPLATE middle-w3c-js-disclaimer-->
 




More information about the Commit-Watchers mailing list