This way I get the reference to the open window:
var refWin = window.open("mypage1", "name_mypage");
if you want to close the window, I close with:
refWin.close();
if I do a screen refresh (F5) and run the same line, it opens in the same window, because I put the same name.
var refWin = window.open("mypage2", "name_mypage");
but with different reference (refWin).
Question: how I can make reference to the window based on the name?, I need to close the window before opening, with the same name.
do something like:
var refWin = window.open("about:blank", "name_mypage");
refWin.close();
refWin = window.open("mypage2", "name_mypage");
but without having to be a blank window for reference.
thanks
my solution based on another script: