Juan Lie
Juan Lie

Reputation: 145

javascript - Closed tab automatically

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

Upvotes: 0

Views: 2395

Answers (2)

mask8
mask8

Reputation: 3638

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

Upvotes: 1

Milan Jaric
Milan Jaric

Reputation: 5646

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

Upvotes: 1

Related Questions