乐趣区

关于javascript:locationhash导致windowclose失效

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

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

退出移动版