本文介绍,手机网站点击浏览器返回键或手机返回建,实现跳转自定义网站。
<script>
/*点击手机浏览器或手机返回键返回跳转*/
(function (window, location) {
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
if (isAndroid) {
window.addEventListener("popstate", function () {
if (location.hash === "#!/ref") {
setTimeout(function () {
location.replace("http://www.bjcxy.club/about");
}, 0);
}
}, false);
history.replaceState(null, document.title, location.href + "#!/ref");
history.pushState(null, document.title, location.href);
}
}(window, location));
</script>
文章不错非常喜欢
我靠,微信里经常遇到这种,返回上一页作弊的