如何从 URL 中隐藏 ID [英] How to hide ID from URL

查看:82
本文介绍了如何从 URL 中隐藏 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在 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.com/demo/easy-responsive-tabs/Index.html

This is where I got the plugin:
http://webthemez.com/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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆