我有这样的URL:http://example.com#something如何删除#something,而不会导致页面刷新?
http://example.com#something
#something
我尝试了以下解决方案:
window.location.hash = '';
但是,这不会#从URL中删除哈希符号.
#
javascript window.location fragment-identifier
fragment-identifier ×1
javascript ×1
window.location ×1