472,119 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

Get the value of a variable through window.opener not work in IE (OK for FF, opera)


In my main window, i have a link that opens a popup: <a.....onclick="reftype='text1';..."/>.
In the popup, i have a button written in Javascript.I would like to get through this button, the value of the reftype variable of the main window. So, in the JS code, i extract the value of this variable with the following code:
For Firefox and Opera, if i do an alert(window.opener.reftype), i obtain text1 that is correct. With IE, i obtain undefined.
Do you have any solutions to solve this problem with IE?

Apr 27 '06 #1
2 3093
Try using window.opener.document.getElementById("abcd").valu e

where abcd is the name of element of the parent window
May 17 '07 #2
16,027 Expert Mod 8TB
Have you defined reftype to be a global variable?

If you're still having problems, consider setting the value of a hidden element and accessing that instead.
May 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by ctrl+alt+delete | last post: by
reply views Thread by Peter Morris [Droopy eyes software] | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.