parent和子弹出窗口之间的sessionStorage

时间:2011-09-26 13:58:02

标签: javascript html5 local-storage

我有一个HTML5页面,其中存储了一些数据:

 window.sessionStorage.setItem('toStore', 'hello world');

然后,我从这个窗口打开一个弹出的:

 window.open('mobile.html', 'myPopUp');

我有一组与这两个页面关联的Javascript函数,我想通过getItem('toStore')调用从popUp访问父页面的本地存储数据。 那可能吗?如果是,那么调用语法是什么? 谢谢

1 个答案:

答案 0 :(得分:6)

将评论转换为答案。

window.opener.sessionStorage.setItem('toStore', 'hello world');
相关问题