简体   繁体   English

如何对用户隐藏 href URL

[英]How to hide the href URL from users

I understand that it is possible to hide the url in the browser status bar by using javascript, but with this method, the url can be seen when the source is viewed from the browser.我知道使用 javascript 可以在浏览器状态栏中隐藏 url,但是使用这种方法,从浏览器查看源代码时可以看到 url。 how to hide URL from downloadlink? 如何从下载链接中隐藏 URL?

We are using PHP Laravel.我们正在使用 PHP Laravel。 I would like to know how to create a link button so that the user does not see the url.我想知道如何创建一个链接按钮,以便用户看不到 url。 I am assuming that this might need to be implemented at the server (controller) side not a view side.我假设这可能需要在服务器(控制器)端而不是视图端实现。 I would like to know the easiest way.我想知道最简单的方法。

There are basically three different ways to hide links in HTML.在 HTML 中隐藏链接基本上有三种不同的方法。

The first way is to use the tag without the href attribute.第一种方法是使用不带 href 属性的标签。 This hides the link from the HTML reader, but the link will still be clickable in the browser.这会隐藏 HTML 阅读器的链接,但该链接仍可在浏览器中单击。

The second way is to use the tag with the href attribute, but place the entire link inside a span tag.第二种方法是使用带有 href 属性的标签,但将整个链接放在 span 标签内。

The third way is to place the entire link inside a span tag, and then you can use CSS to hide that span tag.第三种方法是将整个链接放在一个 span 标签内,然后您可以使用 CSS 隐藏该 span 标签。

Whichever way you choose to hide the link, your link will still be clickable.无论您选择哪种方式隐藏链接,您的链接仍然是可点击的。 When the link is clicked, it will still open in the browser window.单击链接时,它仍会在浏览器 window 中打开。 Hiding links is very easy in HTML.在 HTML 中隐藏链接非常容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM