pushHistory();
window.addEventListener("popstate", function(e) {
window.location = '需返回的页面路径'
}, false);
function pushHistory() {
var state = {
title: "title",
url: "#"
};
window.history.pushState(state, "title", "#");
}
xuanjiange 2020-10-13 16:11 原文
pushHistory();
window.addEventListener("popstate", function(e) {
window.location = '需返回的页面路径'
}, false);
function pushHistory() {
var state = {
title: "title",
url: "#"
};
window.history.pushState(state, "title", "#");
}