View Firefox 3.5 localStorage


/ Published in: JavaScript
Save to your folder(s)

Javascript code to view information stored in firefox 3.5 or 3.0 localStorage


Copy this code and paste it in your HTML
  1. var host = location.hostname;
  2. //var myLocalStorage = globalStorage[host]; // firefox 3+
  3. var myLocalStorage = localStorage; // firefox 3.5+
  4.  
  5. var items = myLocalStorage.length
  6. var s = '<h2>Items for '+host+'</h2><ul>';
  7. for (var i=0;i<items;i++){
  8. var itemName = myLocalStorage.key(i);
  9. s+= '<li><strong>'+itemName+'</strong></li>';
  10. }
  11. $('#footer').html(s+'</ul>');

URL: http://wwwtest.mit.com/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.