SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    client side storage for firefox, chrome & IE

    How to store some strings at the client side for firefox, chrome & IE?

    This code works on firefox & chrome but does not work on IE - no alert window appears.
    Code:
       var key = "localorder";  
       localStorage.setItem(key, 'asc');  
       alert('localorder ' + localStorage.getItem(key));

    This code does not work on firefox, chrome nor IE - no alert window appears.
    Code:
      var key = "order";  
       sessionStorage.setItem(key, 'asc');  
       alert('order ' + sessionStorage.getItem(key));
    I use the Prototype JavaScript Framework on Windows Vista Home.

  2. #2
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    localstore = {};
    
    localstore.order = 'asc';
    
    alert('localorder ' + localstore.order);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •