HTML5 History API & URL 重定向
HTML5 History API & URL 重定向
disabled server url redirect
https://developer.mozilla.org/en-US/docs/Web/API/History_API
https://css-tricks.com/using-the-html5-history-api/
window.history.back();
window.history.go(-1);
window.history.forward();
window.history.go(1);
window.history.go(0);//the same like:
window.history.go();
let numberOfEntries = window.history.length;
let currentState = history.state;
history.pushState()
& history.replaceState()
let stateObj = {
foo: "bar",
};
history.pushState(stateObj, "page 2", "bar.html");
history.replaceState(stateObj, "page 3", "bar2.html");
demo
https://developer.mozilla.org/zh-CN/docs/Web/API/History_API/Example
https://developer.mozilla.org/en-US/docs/Web/API/History_API
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/10564735.html
未经授权禁止转载,违者必究!