Jquery如何替换window.location.hash?

时间:2012-10-02 11:24:39

标签: jquery url hash tabs replace

我怎样才能改变 http://www.example.com/#homehttp://www.example.com/home

我正在使用jquery标签

有可能吗?

2 个答案:

答案 0 :(得分:0)

pushState会做到这一点,虽然支持不是那么好。

在此处阅读:http://badassjs.com/post/840846392/location-hash-is-dead-long-live-html5-pushstate?16328a60

答案 1 :(得分:0)

您可以尝试replace功能:

str = str.replace('#', '');