Wednesday, May 2, 2012

Window.Close() in FireFox

Hi All,

Recently I had a requirement of having an Exit link on my page. On the click of the link the window should close. Everything worked fine in IE (all versions), however in Firefox the jquery was not working to close the window.

After little research found that Firefox out of box doesn't support this behaviour. We need to do a bit setting for get it going. Following are the sets for the same :

1. Open a firefox window, and in the address bar type about:config.
2. Now search for dom.allow, we will get "dom.allow_scripts_to_close_windows".
3. The value for the same will be "false" by default.
4. Double click on it and value will be true. And we are good to go.

Below is the screenshot for the same.







Hope this helps u. :)