Maintain values when using history.back

Asked

Viewed 77 times

0

Guys I have a search page that is all in ajax that is working cool, like the website of Trivago. Only when I change the values of the fields and then I choose one of the answer items I load a new page with the details of the item ai if I click the Back browse button or use the command of javascript history.back() it goes back to the search page more without the values I had changed.

How to store values somewhere so that when it reloads the page via cache it uses these values?

Thank you

  • You can use sessionStorage/localStorage to transition data.

  • @Laerte thanks for the tip gave right. Thank you very much

  • I’ll even post a good example that worked! ;)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.