When I am trying to access an element of my Parent window from a Pop-up window, I am getting window.opener
as undefined.
var opener = window.opener;
if(opener)
{
console.log("opener element found");
var elem = opener.$('.my-parent-element');
if (elem) {
console.log("parent element found");
elem.show();
}
}
Here opener
is undefined. Am I doing something wrong?
I have tried parent.window.opener
/ window.top
/ window.top.document.body
etc., but it doesn't help either. It works fine in other browsers.
I have see the question Window Opener Alternative, but I cannot change opening my popup with showModalDialog
right away. Probably, this would be last option.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…