关于javascript:locationhash导致windowclose失效

通常用 <a target="_blank"></a> 或 window.open() 关上的新窗口能够用 window.close() 办法敞开, 但当新窗口中调用了 location.hash 时(如: react-router 的 hashHistory), 则 window.close() 办法会生效.

解决方案:
绕开 location.hash 办法, 应用 browserHistory 或其余路由形式.

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理