如何从 URL 中隐藏 ID

编程入门 行业动态 更新时间:2024-10-10 00:25:56
本文介绍了如何从 URL 中隐藏 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-05-01 11:01:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408549.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:URL   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!