跳转到锚定标记而不在URL中显示井号 [英] Jump to anchor tag without showing hashtag in URL
本文介绍了跳转到锚定标记而不在URL中显示井号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当用户单击帖子标题时,我当前正在使用jQuery在特定主题标签上加载页面(通过body类中的onload
函数).标签显然显示在url中.我想知道是否存在一种隐藏主题标签的方法,以免使URL混乱.进行了一些搜索,但没有提出太多建议.
I am currently using jQuery to load a page at a specific hashtag (via onload
function in the body class) when a user clicks on a post title. The hashtag obviously shows up in the url. I was wondering if there was a way to hide the hashtag from cluttering up the URL. Did some searches and did not come up with much.
function goToAnchor() {
location.href = "#post";
}
推荐答案
查看全文