About Browser's Local Storage

In JavaScript, you can save some settings to local storage, so that they can be reached on different pages.

1
2
3
4
5
6
7
8
// save the settings object
localStorage.setItem('settings', JSON.stringify(settings));
// load the settings object
let settings = JSON.parse(localStorage.getItem('settings'));
// remove the settings object
localStorage.removeItem('settings');
// clear local storage
localStorage.clear();

Tips and Tricks Programming Architecture JavaScript HTML5