www.webdeveloper.com
Results 1 to 4 of 4

Thread: localStorage with HTML5 and Javascript

  1. #1
    Join Date
    Nov 2013
    Posts
    8

    localStorage with HTML5 and Javascript

    I'm looking at this one to store values from a page and send it to another page and also store them for future use. Is this possible with localStorage? Or will the values stored in variables or arrays disappear when the browser is closed?
    I want to present the stored data in the browser or cell phone. That's why I want to avoid text files or excel files.

  2. #2
    Join Date
    Mar 2012
    Posts
    1,740
    You need to use cookies.

  3. #3
    Join Date
    Mar 2011
    Posts
    1,148
    There is no standard for the persistence of localStorage data. While it would survive a browser close, browsers vary in how they handle the data and users can clear the data manually, so it is best used for short-term needs. So if your data is more complex than cookies normally handle and you want the data to be reliably stored for any extended period, it's best to find a server-based solution (ie. a database).

  4. #4
    Join Date
    Sep 2013
    Posts
    221
    Below is the code for HTML5 local storage:
    if(typeof(Storage)!=="undefined")
    {
    // Yes! localStorage and sessionStorage support!
    // Some code.....
    }
    else
    {
    // Sorry! No web storage support..
    }
    No personal experience but I did come across this link today: http://net.tutsplus.com/tutorials/ht...local-storage/

    Hope this helps.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles