My parent window calls a child window and moves focus to it. This works fine. On the child window I want to set focus back to parent window from child window. This works only if I use alert/confirm on parent window. But I don't want my users to click away alert popups all the time. Is there an opportunity to move focus back?
Parent-Window calls child:
function OpenWindow() {
child = window.open("ZLab/Child", '_blank');
}
Parent-Window sends message and sets focus on child:
function SendMessage() {
child.postMessage({ param: new Date() }, "/");
child.focus();
}
Child-Window calls Parent-Window
function OpenParent() {
opener.GetBack();
}
Parent-Window gets control back. window.focus() doesn't get really focus, just alert/confirm works.
function GetBack() {
alert("Hi, back again");
//window.focus();
}