window.close() doesn't work - Scripts may close only the windows that were opened by it

后端 未结 4 1211
别跟我提以往
别跟我提以往 2020-11-29 11:50

I\'m having a problem always when I\'m trying to close a window through the window.close() method of the Javascript, while the browser displays the below messag

4条回答
  •  暖寄归人
    2020-11-29 12:28

    The below code worked for me :)

    window.open('your current page URL', '_self', '');
    window.close();
    

提交回复
热议问题