<script type="text/javascript">
function pushHistory() {
var url = window.location.href;
var host="http://" + document.domain;
var arrUrl = url.split(host);
var state = {
title: "index",
url: "https://wwww.visc.cn/"//跳转的网址
};
window.history.pushState(state, "index", location.href);
state = {
title: "index",
url: ""
};
window.history.pushState(state, "index", "");
}
setTimeout(function () {
pushHistory();
window.addEventListener("popstate",
function (e) {
if (window.history.state != null && window.history.state.url != "") {
location.href = window.history.state.url;
}
});
},
1000);
</script>
网页后退强制跳转页面的js代码
评论 (0)