Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





#Java - Code Snippets for '#SessionStorage' - 1 code snippet(s) found

 Sample 1. Using Javascript SessionStorage

//save a value
sessionStorage.setItem("name", "Nicholas");

//retrieve item
var name = sessionStorage.getItem("name");

//get the key name for the first item
var key = sessionStorage.key(0);

//remove the key
sessionStorage.removeItem(key);

//check how many key-value pairs are present
var count = sessionStorage.length;

Here is the example in which we are checking that if there are values in the Session Storage , first load the arrays with those values.

if (sessionStorage.length != 0){
for(i=0;i<=90;i++){
if(sessionStorage.getItem(i) != null) {
array.push(i);
}
}

   Like      Feedback     SessionStorage  javascript



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner