Amr Elnashar
Amr Elnashar

Reputation: 1769

Closing Firefox browser by javascript

I'm using simple close browser javascript statement window.close(); but it doesn't work with any browser except IE.

Any help to close browser firefox or opera or chrome. thanks

Upvotes: 1

Views: 721

Answers (2)

Bryan Rowe
Bryan Rowe

Reputation: 9323

Javascript can only close a window that it opened, so unless you pop up a new window with js, you aren't going to be able to close it. Which is obviously a good thing.

Upvotes: 2

Brienne Schroth
Brienne Schroth

Reputation: 2457

you can't close a window with javascript that you didn't open by javascript. Browsers correctly interpret this as behavior their users probably don't want. And the user is the browser's customer, not you, so what they want is what the browser will do.

Upvotes: 8

Related Questions