I have an HTML5 offline app (i.e. there\'s no server-side component/code).
It basically has two windows (parent and child). However, in some instan
You can obtain the reference of child window simply by following trick.
newWin = window.open("", "child_window_name", "width=...");
if (newWin.location.href === "about:blank") {
newWin = window.open("a.html", "child_window_name", "width=...");
} else {
// We've already obtained the reference.
// However, IE and FireFox won't put focus on an already opened window.
// So we have to do that explicitly:
newWin.focus();
}
Note you must have a fixed child window name to make this trick works.
Example URL: http://josephj.com/lab/2011/window-open-reconnect/demo.html