0

Possible Duplicate:
window.close() doesn’t work on Firefox, any work around?

I need to close the current browser window when click on the button using jquery. I tried many ways, but they do not work for all browsers: My code is:

$('#btnCloseBrowser').click(function () {
//                close();
//                this.close();
//                window.parent.close();
//                window.close();
//                self.cose();

            window.setTimeout("window.close()", 1000);
    });
});

// close(); // this.close(); // window.parent.close(); // window.close(); // self.cose();

This works for IE but not work for FIREFOX,CHROME

Community
  • 1
  • 1
user1752833
  • 21
  • 1
  • 1
  • 1

1 Answers1

0

Look at How to close current tab in a browser window?

Note that only windows opened using JavaScript can be closed using window.close() otherwise typically newer browsers don't allow windows to be closed arbitrarily.

Community
  • 1
  • 1
g13n
  • 3,218
  • 2
  • 24
  • 19