I would like to serialize a window object that contains a window, thus to keep in memory the window open if the php page is refreshed by deserializing it and setting its properties back. Is it Possible?
for example:
object = window.open("test.html",..)
Usage Scenario:
When a window is opened its reference is made in the parent window which created it, but when that parent window is refreshed that reference to the child window is lost. Therefore I want to serialize that window object and keep it in case the window is refreshed. Any other solution for this is also welcome.
No, you can´t serialized a window object. And that's because a window object has circular references. Every child of an object has a reference to his parent. JSON.stringify()
does not support circular references. And do not try to keep the reference in a global variable. Global variables are properties of a global object. The properties of this object are the global variables of JavaScript programs. When you declare a global JavaScript variable, what you are actually doing is defining a property of the global object.
For more info please check this link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With