我使用的代码如下:
if (window.history && window.history.pushState) {
window.history.pushState('forward', null, './#forward');
$(window).on('popstate', function () {
window.location.href = "https://www.google.com/";
});
}
Run Code Online (Sandbox Code Playgroud)
我想使用“推送状态”在 URL 中添加 #forward,然后如果用户单击浏览器后退按钮,我想重定向到另一个链接。
工作:它在 chrome 中工作,但不能与“CANARY”搜索引擎一起工作。请帮我弄清楚这个问题。提前致谢。
| 归档时间: |
|
| 查看次数: |
83 次 |
| 最近记录: |