+ 5
How to pass parameters (values) from one web page to another webpage or store and retrieve data from local storage.
Please, Tell me how to store data by only using frontend technologies like HTML/JS or Java.
1 Answer
+ 1
To store data use: localStorage.setItem(key, value)
To read a key use: localStorage.getItem(key)
And if you want to pass data from webside you could use params in the url like this: http://totally.real/url?key1=value1&key2=value2
To get these params on the second page you could use window.location.search.substring(1), whereas substring(1) removes the question mark at the beginning.