Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[e] (0) Fix example now that Storage is no longer string-based.
git-svn-id: http://svn.whatwg.org/webapps@3866 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 16, 2009
1 parent 15ce404 commit 94cda7d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions source
Expand Up @@ -62213,22 +62213,14 @@ style/default.css</pre>
&lt;script>
if (!localStorage.pageLoadCount)
localStorage.pageLoadCount = 0;
localStorage.pageLoadCount = parseInt(localStorage.pageLoadCount, 10) + 1;
localStorage.pageLoadCount += 1;
document.getElementById('count').textContent = localStorage.pageLoadCount;
&lt;/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-->
Expand Down

0 comments on commit 94cda7d

Please sign in to comment.