Maintain reference to popup window over page refresh in Javascript

Does anyone know if there is a way to maintain the reference to a popup window after you refresh the page so you can keep on accessing it?

My initial thought was to stringify the reference variable with JSON, store it in a cookie and eval() it after the page was refreshed, but I haven't had a chance to test it out yet.

Am I on the right track, or is this even possible?



Inside your child window try something like this:

 try{ = window;
 } catch(e){}
}, 300);

I got this from here. It seems to work on all browsers.


Hmm since http / page requests are stateless I don't think that there's any way to keep the reference. I'm not sure what you want to do with the popup, but maybe you can use an iframe or fake the refresh with an Ajax request?

Interesting for sure!


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.