BJ Patel BJ Patel - 7 months ago 40
Javascript Question

JavaScript/ jquery for Closing Browser FireFox / chrome / IE

AS I need JavaScript / jquery Code for Closing Browser's ( FireFox / Chrome and IE..)

As I have try with
window.close()

But it only work for IE.

Is any other way..?

Answer

Can check Browser and write respective script for IE / FireFox

IE---->

window.close()

FireFox --->

var answer = confirm("Do you want to close this window ?");
 if (answer){

netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
    window.close();
 }
 else{
     stop;
 }