M
me
Hello,
I have this script that works in FF and IE, but not in Chrome. I've narrowed
the problem down to this:
1. A script in the main window creates a global variable by declaring it
outside of any function
2. The variable is given a value MyVar = getElementById("MyId")
2. The script opens a popup window
3. A script in the popup window uses window.opener.MyVar to access the
variable
The window.opener doesn't seem to work as expected in Chrome; it points to
the main window (I can use window.opener.close() to close the main window)
but I cannot access the global variable. I tried
window.opener.getAttribute("MyVar") but that doesn't work either. And using
window.opener.document.title caused an error too, so apparently I cannot
access anything except methods. It's not a cross-domain security issue
either.
Anyone have any idea what's going on ? Any help/suggestions welcomed !
(though not of the "global vars are shit", "popup windows are shit", "Chrome
is shit" or "you are shit" variety
Marc.
I have this script that works in FF and IE, but not in Chrome. I've narrowed
the problem down to this:
1. A script in the main window creates a global variable by declaring it
outside of any function
2. The variable is given a value MyVar = getElementById("MyId")
2. The script opens a popup window
3. A script in the popup window uses window.opener.MyVar to access the
variable
The window.opener doesn't seem to work as expected in Chrome; it points to
the main window (I can use window.opener.close() to close the main window)
but I cannot access the global variable. I tried
window.opener.getAttribute("MyVar") but that doesn't work either. And using
window.opener.document.title caused an error too, so apparently I cannot
access anything except methods. It's not a cross-domain security issue
either.
Anyone have any idea what's going on ? Any help/suggestions welcomed !
(though not of the "global vars are shit", "popup windows are shit", "Chrome
is shit" or "you are shit" variety
Marc.