append to url and refresh page

后端 未结 11 2233
终归单人心
终归单人心 2020-12-07 14:07

I am looking to write a piece of javascript that will append a parameter to the current url and then refresh the page - how can I do this?

11条回答
  •  佛祖请我去吃肉
    2020-12-07 14:46

    One small bug fix for @yeyo's thoughtful answer above.

    Change:

    var parameters = parser.search.split(/\?|&/);

    To:

    var parameters = parser.search.split(/\?|&/);

提交回复
热议问题