【发布时间】:2011-03-07 05:51:56
【问题描述】:
我使用 'window.location.hash' 将 '#something' 添加到 URL 而不刷新页面。
我想知道如何做同样的事情,但使用斜杠 (/) 而不是井号 (#)。
为什么?我有导航选项卡,我使用 jQuery 和 Ajax 来动态加载数据。启用 javascript 后,会将“#something”添加到 URL 的末尾以获取数据。当 javascript 被禁用时,它会重定向到 '/something'。所以我想为两者伪造相同的 URL。
而不是http://site.com/section#something -> http://site.com/section/something
谢谢。
【问题讨论】:
-
你为什么不试试
http://site.com/section#/something/anotherthing
标签: javascript jquery url