Forum Moderators: open
We are using window.name to set a hidden value in the browser that persists between page navs on our site. So the first page will set this value, giving the window a name, and this value can be used by the following pages when navigated to. Scenario:
page1:
set window.name = "123";
<user clicks a link to page2>
page2:
window.name still has value "123"
BUT, on some computers the name is replaced with "_unspecifiedFrame":
page1:
set window.name = "123";
<user clicks a link to page2>
page2:
window.name is "_unspecifiedFrame" (!)
Worth noting is that the window name is "_unspecifiedFrame", and not just the empty string "" that seems to be the default otherwise.
Does anybody know what is going on, and how to avoid "_unspecifiedFrame"?
//Mike
If the browser window was initially opened without (or with an empty) window.name, then it will allow its name to be changed and persist the new value.
But if the window was opened with a name, f ex with window.open(url, "myName"), then the supplied "myName" will persist throughout the window's lifetime and cannot be changed. Actually, it will seem like you can change the window.name if you do
window.name="abc"
alert(window.name)
So, I guess the workaround I need to do is to pop a new window (with empty window.name) when I hit these cases.
To wrap up, I should also mention that the reason we were seeing window.name=="_unspecifiedFrame" was because the user had opened the link from an Outlook email message and Outlook supplies the "_unspecifiedFrame" target name.