You are here

How to close the browser in javascript

Intuitively, you would think that if you want to close the main browser window, all you would need is:

[geshifilter-javascript]window.close();[/geshifilter-javascript]

This will actually work on a "fresh" window, but if use has navigated away and back to the page, it may not work.

I have found the following to always work.

[geshifilter-javascript]function CloseApplication() { window.open('', '_self', ''); window.close(); }[/geshifilter-javascript]
Tags: 

Add new comment

Simple Copyright Policy: If you want to reproduce anything on this site, get my permission first.