开发者

sessionStorage between parent and child pop-up

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜