I've got a page which open a new window fullscreen but it still has the other page (the one which re-directs) behind so when you close the new window you are taken back to a blank page.
Is there a way to open a new window and then close the tab which is now inactive?
Currently I have some javascript li开发者_JAVA技巧ke this
window.open("http://website.co.uk");
Thanks
You can technically use window.close()
on the opening tab, but browsers usually will not allow JavaScript to close windows that it has not opened. Can you redirect to some useful page that the user can use once they have closed the window?
If you can add some JavaScript code to the page being opened, I think you can use window.opener.close()
to close the original window. I tested it in IE8, the browser will ask for confirm before close the original window.
精彩评论