2

I want to be able to close the browser window using JavaScript. Is this possible?

Marcel Korpel
  • 21,536
  • 6
  • 60
  • 80
SIr Codealot
  • 5,331
  • 9
  • 33
  • 45

1 Answers1

2
window.close();
hydrogen
  • 2,878
  • 21
  • 20
  • 1
    This is the only way. In modern browsers, it works only if the current window has been opened by a script instance; otherwise, a warning dialog will be shown or nothing will happen at all. – Pekka Sep 04 '10 at 23:19