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:


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() {'', '_self', ''); window.close(); }[/geshifilter-javascript]

Add new comment

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