简体   繁体   English

href =“#”在状态栏中显示完整的URL

[英]href=“#” shows full URL in status bar

在此处输入图片说明

Please check attached screenshot. 请检查附件的屏幕截图。 I am trying add a few links in my project that basically do nothing until a valid value is added. 我正在尝试在项目中添加一些链接,这些链接在添加有效值之前基本上什么也不做。 But when I look at the status bar it shows full url with # at the end of it. 但是,当我查看状态栏时,它会在其末尾显示带#的完整网址。 I would like to avoid this if possible. 如果可能,我想避免这种情况。 Is there a way I can do this? 有办法吗? Thanks! 谢谢!

Here's a link to the codepen - https://codepen.io/retrn0/pen/qpjrLB 下面是对codepen链接- https://codepen.io/retrn0/pen/qpjrLB

 <a href="#"> <img src="http://matthewpalmer.net/rocket/icon.png"></img> </a> 

As suggested in the comments, you can remove href entirely. 如评论中所建议,您可以完全删除href

Alternatively, you can use href="javascript:void(0)" which basically does nothing when clicked on. 或者,您可以使用href="javascript:void(0)" ,该内容在单击时基本上不执行任何操作。

if you want to read more about void operator, you can do so here 如果您想了解有关void运算符的更多信息,可以在这里阅读

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

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