【发布时间】:2012-01-13 18:41:00
【问题描述】:
在jquery mobile中我正在使用
$('#somebutton').click(function () {
$.mobile.changePage("#searchResult", "slide");
});
切换到另一个页面。这个#searchResult 被添加到 URL 中我不希望发生这种情况....那么我该如何从 URL 中删除它。
提前致谢。
【问题讨论】:
-
如果添加“location.hash = '';”会发生什么?
-
您在页面加载时尝试过
location.hash = "";吗? -
@Joseph :如果我指定 location.hash = "";像这样然后页面返回到父页面我想留在searchResult页面本身。
-
我自己找到了解决方案 $.mobile.changePage("#details", { transition: "slide", reverse: false, changeHash: false });我们只需要将 changeHash 和 reverse 参数设置为 false。无论如何感谢@Aaron Joseph 的回答。
标签: jquery url hyperlink jquery-mobile