how to make location.href with an anchor and updating the page, that is, we have:

document.location.href = '/stream#post_321'; 

If this code is executed from the / stream page, then the page will not be updated, but only the anchor will be dropped.

Is it possible to somehow make the page refreshed, and then the anchor triggered on # post_321?

  • document.location.reload() - ThisMan 2:29 pm
  • No need to mock the page. - Qwertiy
  • @ThisMan but you can do it right away without updating because I did it right away, but it twitches several times and I don’t like it document.location.reload () document.location.href = '/ stream # post_321'; - Merlin
  • and if the opposite? - ThisMan
  • document.location.assign('/stream#post_321') - Ilya Zelenko

0