Home  >  Q&A  >  body text

javascript - history.replaceState() cannot change query parameters

If the url is http://xxx.com?a=1&b=2, you need to change the value of the a parameter to 2 through history.repalceState(), but b remains unchanged. How to deal with it?

大家讲道理大家讲道理2674 days ago944

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-06-24 09:45:54

    First take out a=1&b=2, and then process the string

    reply
    0
  • Cancelreply