-1

Possible Duplicate:
How can I close a window with Javascript on Mozilla Firefox 3?

i used the code window.close();

it works well for Internet Explorer but it not worked in firefox

Community
  • 1
  • 1
Prabakaran
  • 221
  • 4
  • 9
  • 19

2 Answers2

0

check in "about:config" the value of "dom.allow_scripts_to_close_windows" anyway, did you tried with self.close();

MiPnamic
  • 1,257
  • 10
  • 18
0
  window.close()

can only be used on windows you created with

  window.open() 

or the Current window, in most common browsers that respect the scope of JavaScript in a user-friendly way. When this method it calls it checks the

  window.opener

The access to other windows is prohibited due to security reasons. (other websites could close your windows without telling ;)

IE goes a bit out of that bounds with some (tiny-small) lack of taking care of the security side effects (IE. risks)

more here

Caspar Kleijne
  • 21,552
  • 13
  • 72
  • 102