/ Published in: JavaScript

Javascript code to view information stored in firefox 3.5 or 3.0 localStorage
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var host = location.hostname; //var myLocalStorage = globalStorage[host]; // firefox 3+ var myLocalStorage = localStorage; // firefox 3.5+ var items = myLocalStorage.length var s = '<h2>Items for '+host+'</h2><ul>'; for (var i=0;i<items;i++){ var itemName = myLocalStorage.key(i); s+= '<li><strong>'+itemName+'</strong></li>'; } $('#footer').html(s+'</ul>');
Comments
