i need to close the browser or tab automatically after it open, to do like confirmation page, " Thanks for something, browser gonna close after 2 seconds".
so i try this :
<div id="Success" class="Content" onload="winClose()">
...
<script language="JavaScript" type="text/javascript">
function winClose() {
window.setTimeout("window.close();",2000)
}
</script>
but, the window.close() method can be execute if the browser/tab was open by a script
Les scripts ne peuvent pas fermer une fenêtre qui n’a pas été ouverte par un script.
Scripts can not close a window that has not been opened by a script.
so, i got a window opening where the user choose between 4 choices, and on click, they fall on a page that tell to the user, that the choice as been register successfully, and Automatically close after 2 seconds. btw im on silex microframework, so if something with controller is possible, tell me.
how can i do this "Automatically close things" without opening the browser/tab by a script ?