JS浏览器Session存取数据


 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");

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM