问题描述
限时送ChatGPT账号..我以前在 Stack Overflow 上看到过这类问题,但没有一个真正有帮助.我也用谷歌搜索过,但没有骰子.
I've seen this type of question in Stack Overflow before and none of them help really. I've also Googled it but no dice.
我想知道如果用户点击标签本身,是否可以从 URL 中隐藏 ID?
I'm wondering if it's possible to hide the ID from the URL if the user clicks on the tabs itself?
这是网页:
www.planet.nu/dev/new-experian/index.html
然后当我点击一个标签时,会发生以下情况:
www.planet.nu/dev/new-experian/index.html#dataTab1
Then when I clicked on a tab, this is what will happen:
www.planet.nu/dev/new-experian/index.html#dataTab1
我听说使用 Javascript 实际上可以隐藏它,但我不确定如何.我的客户非常热衷于隐藏此类 ID,使其不会出现在 URL 上,即使它没有任何危害.
I heard that using Javascript can actually hide that but I'm not sure how. My clients are really keen to hide such ID from appearing on the URL even though it does no harm.
这是我得到插件的地方:
http://webthemez/demo/easy-responsive-tabs/Index.html
This is where I got the plugin:
http://webthemez/demo/easy-responsive-tabs/Index.html
如果没有其他解决方案,那么我可能需要为此更改 jQuery 代码.:(
If there are no other solutions, then I might have to change the jQuery code for this. :(
推荐答案
我所做的是在 'easyResponsiveTabs.js' 中搜索
What I've done is in 'easyResponsiveTabs.js' search for
var newHash = respTabsId+(parseInt($tabAria.substring(9),10)+1).toString();
用
var newHash = "";
然后搜索
newHash = '#'+newHash;
用
newHash = ''+newHash;
享受吧!
这篇关于如何从 URL 中隐藏 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论