What Is Windows.LocalStorage?
Local Storage Without affecting web application performance. Local Storage is more secure. It can store large amounts of data.(10MB). Local Storage can store one page that can access web application All pages. Each And Every domain its own local storage variable.
- To Set Local Store in web application then you can use below syntax,Syntax: Windows.localStorage.setItem(Variable,value);
- To get Local Storage value,Syntax: Windows.localStorage.getItem(Variable,);
- To Remove Value in Local Storage Variable,Syntax: Windows.localStorage.removeItem(Variable,);
Example:
- <html>
- <script type="text/javascipt">
- windows.onload = setValue; function setValue(){ windows.localStorage.setItem("UserName","Kamal Bhagat") } function onClick(){ document.getElementById("txtUserName").text = windows.localStorage.getItem("UserName") }
- </script>
- <body>
- Username:
- <input type="text" id="txtUserName">
- <br>
- <input type="submit" value="click" onclick="setValue();">
- </body>
- </html>
More Information About Below Link You can See:
- HTML5 Local Storage
- https://msdn.microsoft.com/en-us/library/bg142799(v=vs.85).aspx11
Join the conversation! Your thoughts help the community grow.