在MJQ中,如何从URL中删除哈希? [英] In MJQ How can i remove hash from the URL?

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

问题描述

即使单击新页面链接,我也希望将带有哈希的URL删除为没有哈希的URL.例如:

i would like to remove the url's with hash to just the without hash urls, even while the click the new page links. as a exaple:

如果我有这样的网址:

http://localhost/mygame/#interface

然后应该是这样的:

http://localhost/mygame/

但是,在单击链接时,必须浏览页面.为此,我使用了这样的功能:

but, while click on the links, the page has to navigate. for that, i used the function like this :

$('a.play').bind('click',function(){ changePage("#interface", "flip", true, false);  });

但是我没有得到所需的结果,即使我从链接中删除了#".有什么好主意吗?

but i am not get the required result, even i removed the '#' from the link. any good idea?

推荐答案

您似乎正在使用旧版本的jQuery Mobile.在1.0 Beta 2之后(我相信),他们增加了对从URL中删除哈希值的支持.如果您使用新版本的jQuery Mobile,则默认情况下将启用此行为.

It looks like you're using an old version of jQuery Mobile. After 1.0 Beta 2 (I believe) they added support for removing the hashes from the URL. If you use a new version of jQuery Mobile this behavior will be enabled by default.

您可以在此处下载jQuery Mobile的最新稳定版本: http://jquerymobile.com/download/

You can download the latest stable version of jQuery Mobile here: http://jquerymobile.com/download/

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

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