I am not able to restore a created array in html and reuse it again. I have used Json but do not work with me. in the below code. I'm trying to reload items which is an array created in another page. when i try to load it, it did not work. how can i fix this? does json need header file? Thank you.
$( document ).ready(function() {
var count=sessionStorage.getItem('items');
)};
The
sessionStorage
property allows you to access a session Storage object for the current origin.It is two way process first of allstringify
object before storing to session and secondparse
to getting back .Here is fiddle.Opening a page in a new tab or window will cause a new session to be initiated. More About session storage.