1
1
109k42020-04-17 23:17:08
JavaScript
109k4, 2020-04-17 23:17:08

How to fix page reload bug when using history.pushState API?

Hello.
pushState writes a link to the address bar and when I reload the page, the browser follows a non-existent link. How to avoid this, how to change the position in the browser history before the moment when the browser starts reloading the page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-04-17
@109k4

well, why change the url if there is no new url handler?
they change it precisely so that people have the opportunity to copy the link and then immediately get to the right place through it
("How to avoid this": I think it’s impossible)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question