简体   繁体   English

这是什么意思? javascript://

[英]What does this mean? javascript://

I'm having a strange problem in google voice where I can't expand the details of text messages. 我在Google语音中遇到一个奇怪的问题,我无法扩展短信的详细信息。 When I click on the link in the text that says something like "5 more messages", instead of expanding to show me the rest of the messages, nothing happens. 当我单击文本中的链接,如“另外5条消息”时,没有展开以向我显示其余消息,什么也没有发生。 javascript:// is displayed in bottom of the browser when I hover over the link as if I'm going to visit a hyperlink. 当我将鼠标悬停在链接上时,好像要访问超链接一样,javascript://会显示在浏览器的底部。 Happens in all browsers. 发生在所有浏览器中。 Nothing shows up in Dev tools. 开发工具中什么都没有显示。 I really just want to know what javascript:// is supposed to do or mean. 我真的只想知道javascript://应该做什么或意味着什么。

In HTML specification, every a tag has to be a valid href attribute. 在HTML规范中,每个标签都必须是有效的href属性。 So when you make a link that does something on click, but don't want to make any changes on page (giving a # can lead the browser to top) you can write this empty but valid javascript code. 因此,当您创建一个可在点击时执行某些操作的链接,但又不想在页面上进行任何更改时(给出一个#可使浏览器到达顶部),您可以编写此空但有效的javascript代码。 It does nothing. 它什么也没做。

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

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