0

I want to closed current browser tab after pop up 'Thank you' disappeared.

<script language='javascript'>
alert('Thank you.'); 
window.close();
</script>

But It didn't works and still white blank screen. How to make to close automatically the white blank screen???

Please to help.

Noted: Support for all web browser.

Thanks

Juan Lie
  • 145
  • 1
  • 3
  • 8
  • this same code worked on my side. maybe you want to loose the `language='javascript'` – Ibu Aug 18 '12 at 01:01
  • You can't close the current tab (in most browsers). Look http://stackoverflow.com/questions/2076299/how-to-close-current-tab-in-a-browser-window – Alexandre Khoury Aug 18 '12 at 01:14

2 Answers2

1

if you want to close window in which javascript executes use self.close()

Milan Jaric
  • 5,556
  • 2
  • 26
  • 34
1

Some browsers don't allow javascript to close window automatically when the windows is NOT opened by script. close needs to be lead by user interactions. if your code is not working, it is probably because of it

mask8
  • 3,560
  • 25
  • 34