链接以两个斜线开始 [英] Links start with two slashes
问题描述
< a href =// example.com/1.png\"> Image< ;; a>
为什么会这样?
这是一个协议相对URL (通常是HTTP或HTTPS)。因此,如果我位于 这可以让您轻松避免混合内容安全错误。 More and more, began to notice that the links in the source code on Web sites begin with two slashes. For example: Why do it? It's a protocol-relative URL (typically HTTP or HTTPS). So if I'm on This lets you easily avoid mixed content security errors. 这篇关于链接以两个斜线开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! http://example.org
,并且链接(或包含图片,脚本等)到 //示例.com / 1.png
,它会转到 http://example.com/1.png
。如果我位于 https://example.org
,它会转到 https://example.com/1.png $ c
<a href="//example.com/1.png">Image</a>
http://example.org
and I link (or include an image, script, etc.) to //example.com/1.png
, it goes to http://example.com/1.png
. If I'm on https://example.org
, it goes to https://example.com/1.png
.