I need to close the popup windows in the following after 3 seconds. How do I do it.
<map id="ImgMap0" name="ImgMap0">
<area alt="" coords="127, 22, 20" alt="" title="click here" href="includes/popup1.htm" onclick="javascript:void window.open
('includes/popup1.htm','1366002941508','width=500,height=200,left=375,top=330');return false;" shape="circle" />
</map></p>
open("URL_HERE", "my_window", "height=100,width=100"); and we need to close the second page automatically after login success. Okay so in the popup use window. close() to close the window like I mentoined in my example.
Scripts may close only the windows that were opened by it. A workaround now is redirect user to another page rather than close the window, you could redirect user to a notification page to show "The items has been closed successfully" using window. location. href="PageUrl".
Use a setTimeout, for example:
var win = window.open("http://www.google.com", '1366002941508','width=500,height=200,left=375,top=330');
setTimeout(function () { win.close();}, 3000);
Sample fiddle: http://jsfiddle.net/N5rve/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With