首页 > Web开发 > 详细

JS浏览器Session存取数据

时间:2017-02-08 16:00:26      阅读:563      评论:0      收藏:0      [点我收藏+]
 vm.indexdata.indexId = id;
 vm.indexdata.indexName = name;
 var tempIndex = JSON.stringify(vm.indexdata);
 window.sessionStorage["searchIndex"] = tempIndex;


//调用取值
JSON.parse(window.sessionStorage.getItem("searchIndex")).indexId
JSON.parse(window.sessionStorage.getItem("searchIndex")).indexName)

//判断session是否存在
 if (window.sessionStorage["searchIndex"]) 
{
}

//移除session
window.sessionStorage.removeItem("searchIndex");

 

JS浏览器Session存取数据

原文:http://www.cnblogs.com/Aaron-Lee/p/6378468.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!