简体   繁体   中英

What does this mean? javascript://

I'm having a strange problem in google voice where I can't expand the details of text messages. 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. javascript:// is displayed in bottom of the browser when I hover over the link as if I'm going to visit a hyperlink. Happens in all browsers. Nothing shows up in Dev tools. I really just want to know what javascript:// is supposed to do or mean.

In HTML specification, every a tag has to be a valid href attribute. 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. It does nothing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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