0

Inside a program the user navigates around, and they want the history that is generated by window.history.pushState to work with their back button in their browser (because for whatever reason they will not click the back buttons in the application)

window.history.pushState({"html":'Visited Page',"pageTitle":'Page Title'},"",'http://exampleurl.com/item/');

To catch them hitting the back button I simply use:

$(window).on("popstate", function(e) {
    // history.go(-1); 
    /* As you can see this was an attempt to make it work it only goes back to the last actual page visit */
});

How do I get the last URL in their history to then window.location and send them there, or better yet how do you make the browser respect the pushed history?

Or is there anyway to get what the URL was.

Case
  • 3,859
  • 4
  • 31
  • 48

0 Answers0