是否将 onpopstate 绑定到 hashchange?
作者: DanielMiddleton创建于 2015年6月8日更新于 2023年5月30日
标签buginternet explorerie10ie11
今天下午我遇到了一个 bug,在 IE (10 和 11) 中,某些路由无法正常工作。我们在某些页面内路由中使用哈希值(但不包括 hashbang),以触发加载某些覆盖图层。路由会被填充,但内容不会显示,因为 onpopstate 事件未被触发,因为它只是哈希值的更改。将 onpopstate 绑定到 page.start 中的 hashchange 事件可解决我的问题:
内容来源: visionmedia/page.js