How to suppress IE9 window.close() confirm message

2019-07-06 13:42发布

After applying the window.close function IE9 raises the "The webpage you are viewing is trying to close ..." message. Is there a way to suppress this message without changing the application code, but by changing some IE-specific registry entries instead?

1条回答
相关推荐>>
2楼-- · 2019-07-06 14:44

IE doesnt allow to close the window without confirmation if the window was not opened by script
U can try this ...
window.open('', '_self', '');
window.close();

查看更多
登录 后发表回答