从URL删除哈希 [英] Removing hash from URL

查看:575
本文介绍了从URL删除哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 window.location.hash从URL删除散列后=''页面重新加载得到在Firefox。

After removing hash from URL using window.location.hash='' page getting reloaded in firefox.

修改

例如:

wwww.Mysite.come /#=页1

在按钮我使用删除散列值以下code的点击

On a click of button I am removing hash value using following code

window.location.hash =''

删除散列页后得到重新加载在Firefox。

After removing the hash page is getting reloaded in firefox.

我不想重新加载页面我只是想删除URL散列

I don't want to reload page I just want to remove hash from URL

如何解决?

推荐答案

的https:/ /developer.mozilla.org/en/DOM/window.location :

例子

每当位置对象的属性被修改时,一个文档
  将使用URL加载仿佛window.location.assign()已
  所谓与修改后的URL。

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的:

This question I think addresses what you want using jQuery:

jQuery中

其他相关问题:

<一个href=\"http://stackoverflow.com/questions/136458/change-the-url-in-the-browser-without-loading-the-new-page-using-javascript\">Change该网址在浏览器中,而无需加载使用新的页面的JavaScript

<一个href=\"http://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-with-javascript-without-page-refresh\">How从用javascript window.location的删除哈希不刷新页面?

<一个href=\"http://stackoverflow.com/questions/6312518/how-can-i-change-firefox-window-location-hash-without-creating-a-page-reload\">How我可以改变Firefox的window.location.hash而无需创建一个页面重载?

这篇关于从URL删除哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆