标签: javascript regex url hash
例如,我有:
http://www.example.com/index.php#/parameter1=one/parameter2=two/
现在我该如何仅更新parameter1的值?
parameter1
答案 0 :(得分:2)
location.href.replace(/#\/parameter1=\w*/, "#/parameter1="+NEW_VALUE)