开发者

sessionStorage between parent and child pop-up

开发者 https://www.devze.com 2023-04-08 23:58 出处:网络
I have an HTML5 page where I store some data with: window.sessionStorage.setItem(\'toStore\', \'hello world\');

I have an HTML5 page where I store some data with:

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

Then, I open from this window a pop-up one with:

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

I have a set of Javascript functions associated to the two pages, where I want to access the local storage da开发者_StackOverflow中文版ta of parent page from the popUp with the getItem('toStore') call. Is that possible? If yes, what's the calling syntax? Thanks


Converting comment to answer.

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

精彩评论

暂无评论...
验证码 换一张
取 消