Java Reference
In-Depth Information
Setting, getting, and removing data from web storage is simple. You can either use
localStorage 's getItem() , setItem() , and removeItem() methods, or you can assign and
use properties on localStorage itself.
The data stored in web storage is converted to strings. So, you have to convert the data
back into its appropriate data type in order to effectively use it. This is easily done thanks to
various functions like parseInt() , Date 's constructor, and JSON.parse() .
exerCises
You can find suggested solutions to these questions in Appendix A.
1. Using local storage, create a page that keeps track of how many times the page has been
visited by the user in the last month.
2. Use local storage to load a different advertisement every time a user visits a web page.
 
Search WWH ::




Custom Search