history.pushState() change query values

后端 未结 3 1992
一个人的身影
一个人的身影 2020-12-10 15:01

If I have a link that is being changed with the function history.pushState({}, \"\", link); where my link is for example page.php?value=1&

3条回答
  •  感动是毒
    2020-12-10 15:57

    If what you're trying to do is change the URL without adding an additional entry to the history object, you might try replaceState.

    history.replaceState({value: 1, value2: X}, "title", "page.php");
    

提交回复
热议问题