Although this topic has been dormant for awhile, I would like to revive it as I have just gotten interested in using DOM storage to hold a large list of names. The idea is to load them via php and JS then to open a new page where a JS array can be loaded from the DOM stored data. The purpose is to avoid revealing the names to someone who would see then with a View Source command if I used traditional JS to populate the array I am a Mac person and I have just downloaded FireFox 3.5(beta). Also Safari 4.0(beta). The non-beta versions do not implement DOM storage so it seems.
I am learning as I go using an example script:
Code:
<!DOCTYPE5 html>
<html>
<head>
<title>testDOMstorage</title>
</head>
<body>
<p>
You have viewed this page
<span id="count">an untold number of</span>
time(s).
</p>
<script language="javascript">
var storage = window.localStorage;
if (!storage.pageLoadCount) storage.pageLoadCount = 0;
storage.pageLoadCount = parseInt(storage.pageLoadCount, 10) + 1;
document.getElementById('count').innerHTML = storage.pageLoadCount;
</script>
</body>
</html>
Which works but leaves me puzzled as to where the stored data is on my drive. Also, I was assuming the data would not persist after closing the window but it does, and it's still there after a complete re-boot!
Obviously I have a long way to go in understanding how to use this capability but since it now available for more browser types it seems well worth learning.
PS, Thanks to Paul Davis (willcode4beer) for getting me interested in this.
Last edited by jimandy; 05-28-2009 at 01:50 PM..
Reason: Add PS
|