How can I change the last component of a url path?

前端 未结 7 877
一整个雨季
一整个雨季 2021-02-09 03:15
\"http://something.com:6688/remote/17/26/172\"

if I have the value 172 and I need to change the url to 175

\"http://something.com:6688/         


        
相关标签:
7条回答
  • 2021-02-09 04:11

    You can't actually change the URL that is shown in the address bar with javascript without a page refresh. If this was possible it would represent a fairly substantial security issue in my opinion. If you can live with a page refresh, window.location is your best option.

    If you are using jQuery, the jQuery BBQ plugin is pretty neat. It handles a lot of the hard work for you.

    0 讨论(0)
提交回复
热议问题