Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更改我写笔记的页面上的查询字符串。当我保存笔记时,我希望查询字符串具有该笔记的条目。因此,在初始保存后,用户可以根据查询字符串进行更新。但是要更新查询字符串,我需要进行完整的回发。反正有没有像这样改变查询字符串?
不,您不能在不重新加载的情况下更改当前查询字符串。您可以使用网址的片段部分(#)。设置片段部分可能允许您在浏览器历史记录中添加一些条目而无需重新加载。
#
例如,如果您当前的 url 是http://example.com/foo您可以在http://example.com/foo#bar=baz不重新加载当前页面的情况下将其更改为。
http://example.com/foo
http://example.com/foo#bar=baz