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.

function CloseApplication() {'', '_self', '');

Add new comment

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