• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

window.onstorage event not firing

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working on a workaround with a synch'ing parent window, child window and grandchild window. I want to refresh the parent from the grandchild in case the child window is closed and the opener chain is broken. I figured on setting a localStorage variable, my_variable, in the grandchild (when it's opener, child, is closed) and putting the following in the parent onload...



I've verified my_variable value by adding localStroage.getItem("my_variable") to a button on the parent. So even when child is closed, the localStorage value does get to the parent. So I think the problem is with capturing the onstorage event. But it seems so straightforward and the parent onload executes to completion, i.e. the above throws no error. i should add this is legacy IE11 rendering as IE 9, but everything I've read said that code should work.

the target parent is within an iframe so i also tried...



and nothing. I've run the wsschools tutorials in the same browser with the above and it works there. I am so frustrated. Thank you very much for any ideas.
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic