I have a situation where a link opens a new window(child) using Javascript. I am trying to pass a variable to the child window fo开发者_如何学Gorm the parent window by attaching to the new window's window
object.
In the parent:
var wnd = open(file, name, attribs);
wnd.a = 10;
In the child when I do
window.a;
IE says undefined. This works on Chrome, Firefox and Safari.
Where am I going wrong?
Wait until the new window has loaded before setting the variable on its window
object. In IE you may need to handle the load
event within the new window rather than the main window.
精彩评论