微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jquery – 从URL中删除哈希

使用window.location.hash =”页面从URL中删除哈希后,在firefox中重新加载.

编辑

例:

wwww.Mysite.come /#页= 1

单击按钮我将使用以下代码删除哈希值

window.location.hash = ”

删除哈希页面后,在firefox中重新加载.

我不想重新加载页面我只想从URL中删除哈希

怎么解决

解决方法

https://developer.mozilla.org/en/DOM/window.location开始:

Examples

Whenever a property of the location object is modified,a document
will be loaded using the URL as if window.location.assign() had been
called with the modified URL.

这个问题我认为使用jQuery解决你想要的问题:

Change hash without reload in jQuery

其他相关问题:

Change the URL in the browser without loading the new page using JavaScript

How to remove the hash from window.location with JavaScript without page refresh?

How can I change Firefox window.location.hash without creating a page reload?

原文地址:https://www.jb51.cc/jquery/181364.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐