I need to close a new window after it fully loads. I have:
my_window=window.open("http://www.yahoo.com", "_blank", "resizable=yes, scrollbars=yes, titlebar=yes, width=500, height=400, top=10, left=10");
I've tried:
my_window.onload = my_window.close();
and
my_window.addEventListener('load', my_window.close(), true);
Neither wait for my_window to finish loading before closing (it closes pretty much immediately).
Secondary question, can I add a timeout to go ahead and close the new window in case the page stalls and for some reason never fully loads?