I'm seeing a strange behavior in Google Chrome, using the window.name
property.
For example:
open a tab and go to http://google.com .
Open up console, and type window.name="hello"
.
Now in the same tab, go to http://chase.com.
In the console, type window.name
.
I expect to see "hello"
returned, but instead I see ""
.
Is this a known issue for Google Chrome? It works for me in FireFox.
Anyone have any insight to this behavior?
Thanks!
If, instead of typing in a new URL, I type window.location="http://chase.com"
, then the window.name
persists!
window
is a global object for each document, not for the browser window. In a page with iframes you will have one window
for each iframe for example. Each time a document is loaded, a new global object is created and populated for the context. When the document is unloaded, the global object along with all its data is destroyed.
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