可能重复: 我可以将所有链接更改为//?
我最近遇到了这个问题,同时探索了谷歌404页面的标记。在其中,他们使用//在他们的URL的开头,在标记中的锚点,以及在他们的CSS中引用图像/等。
I came across this recently whilst poking around the markup for Google's 404 page. In it, they use // at the start of their URLs, in anchors in the markup, as well as referencing images/etc in their CSS.
因为它不是什么东西我之前遇到过,并且考虑到谷歌在有限细节优化方面臭名昭着,我想我会在这里询问是否有人有关于使用//的更多信息而不是http://这不是可以很容易地用Google搜索来找到答案。
Since it's not something I've come across before, and given that Google is notorious at finite-detail optimisation, I thought I'd ask here and see if anyone has any more information on the use of // instead of it's not something that can be easily Googled about to find an answer.
我知道//在http或https可能起作用的应用程序中很有用,但是除此之外,还有其他好处吗?是否所有浏览器都支持?有任何使用限制吗?这是新的/旧的吗?
如果有人有任何信息,我会非常感兴趣。
I'd be really interested if anyone has any information.
推荐答案// 是无论目前的协议是什么。
// is "Whatever the current protocol is".
在通过http提供的页面上,它是 http:// ,而在https上它是 https:// 。
On a page served over http, it is , and over https it is .
更多推荐
Web开发中http://和//之间有什么区别?
发布评论