Web开发中http://和//之间有什么区别?

编程入门 行业动态 更新时间:2024-10-24 23:26:32
本文介绍了Web开发中http://和//之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可能重复: 我可以将所有链接更改为//?

我最近遇到了这个问题,同时探索了谷歌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://和//之间有什么区别?

本文发布于:2023-11-23 05:05:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620187.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   Web   http

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!