Posted By

linusx on 04/09/10


Tagged

view Firefox localstorage


Versions (?)

View Firefox 3.5 localStorage


 / Published in: JavaScript
 

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

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

  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>');

Report this snippet  

You need to login to post a comment.