Browser state note

There are 3 functions which help us to interact with browser state:

  • window.history.pushState
  • window.history.replaceState
  • window.history.back

window.history.pushState(state_object, site_title, site_url): This function will push one state to the state array and set this state is the current state.

window.history.replaceState(state_object, site_title, site_url): This function will replace the current state with the new one.

window.history.back: This function will make the browser back to the previous state.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: