Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

self.close() not working for mozilla

Tags:

javascript

self.close() is working fine in IE but not in Mozilla. Does anyone know what is the issue and how can I solve it?

like image 243
Jin Yong Avatar asked Feb 23 '26 09:02

Jin Yong


1 Answers

Did you open the window using window.open? According to the docs on window.close:

This method is only allowed to be called for windows that were opened by a script using the window.open method. If the window was not opened by a script, the following error appears in the JavaScript Console: Scripts may not close windows that were not opened by script.

like image 106
Paolo Bergantino Avatar answered Feb 25 '26 23:02

Paolo Bergantino