Categories
Mobile

mobile: client side local storage for Safari on the iphone

localStorage.setItem('age', 40); // Stores "age" js variable locally
var age = localStorage.getItem('age'); // Gets the value
localStorage.removeItem('age'); // Remove the item
localStorage.clear(); // Removes all local storage

Use sessionStorage instead if you just want to store it for as far as the window session is alive.

Leave a Reply

Your email address will not be published. Required fields are marked *