Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mobile back button redirect Code
#1
Code:
(function(window, location) {
history.replaceState(null, document.title, location.pathname+"#!/history");
history.pushState(null, document.title, location.pathname);


window.addEventListener("popstate", function() {
 if(location.hash === "#!/history") {
   history.replaceState(null, document.title, location.pathname);
   setTimeout(function(){
     location.replace("http://www.redirect-url.com");
   },0);
 }
}, false);
}(window, location));
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)