URL 中 http 协议声明中的正斜杠
Forward slashes in http protocol declaration in URL
我刚刚注意到在 HTML 表单验证中 url 输入类型不需要 protocol:
后的双正斜杠 '//
' .我尝试在许多没有正斜杠的浏览器中输入 URL,它们都有效,例如http:www.web-dewd.com 适用于 Chrome、Firefox、Edge、Opera,我敢说,甚至是 IE11。
我找不到任何具体的定义来说明是否需要它们。我花了好几分钟 https://www.w3.org/standards/ without any luck. The best I could find was an interview with Tim Berners-Lee stating they are not required: http://www.dailymail.co.uk/sciencetech/article-1220286/Sir-Tim-Berners-Lee-admits-forward-slashes-web-address-mistake.html :
But with the colon in there as well, it turns out people never use the slash slash...
来自 ZDNet 的 article 指出:
there is practically no reference to the double forward-slash on the web
我认为建议使用斜杠,但有谁知道并能够提供证据证明正确的标准是什么?
有点讽刺的是,Whosebug 在输入 link 时确实需要 //
,其他编辑器在确定将文本转换为 link 时也是如此,例如微软 Outlook。
PrePrefix: To be a Uniform Resource Locator as currently defined by the URI
working group, the whole string must start with a constant prefix
"URL:"
这部分说有效的 URL 以 protocol:
开头并且没有说明任何关于 //
Internet protocol parts Those schemes which refer to internet protocols mostly have a
common syntax for the rest of the object name. This starts with a
double slash "//" to indicate its presence, and continues until the
following slash "/".
表示URL的字符串必须以protocol:
开头,//
只是表示域名开头的常用语法。
替换 URL 时,您通常会查找 http[s]://
而不是 http[s]:
。这只是常见做法,并不意味着所有 Web 开发人员都会使用它。
我刚刚注意到在 HTML 表单验证中 url 输入类型不需要 protocol:
后的双正斜杠 '//
' .我尝试在许多没有正斜杠的浏览器中输入 URL,它们都有效,例如http:www.web-dewd.com 适用于 Chrome、Firefox、Edge、Opera,我敢说,甚至是 IE11。
我找不到任何具体的定义来说明是否需要它们。我花了好几分钟 https://www.w3.org/standards/ without any luck. The best I could find was an interview with Tim Berners-Lee stating they are not required: http://www.dailymail.co.uk/sciencetech/article-1220286/Sir-Tim-Berners-Lee-admits-forward-slashes-web-address-mistake.html :
But with the colon in there as well, it turns out people never use the slash slash...
来自 ZDNet 的 article 指出:
there is practically no reference to the double forward-slash on the web
我认为建议使用斜杠,但有谁知道并能够提供证据证明正确的标准是什么?
有点讽刺的是,Whosebug 在输入 link 时确实需要 //
,其他编辑器在确定将文本转换为 link 时也是如此,例如微软 Outlook。
PrePrefix: To be a Uniform Resource Locator as currently defined by the URI working group, the whole string must start with a constant prefix "URL:"
这部分说有效的 URL 以 protocol:
开头并且没有说明任何关于 //
Internet protocol parts Those schemes which refer to internet protocols mostly have a common syntax for the rest of the object name. This starts with a double slash "//" to indicate its presence, and continues until the following slash "/".
表示URL的字符串必须以protocol:
开头,//
只是表示域名开头的常用语法。
替换 URL 时,您通常会查找 http[s]://
而不是 http[s]:
。这只是常见做法,并不意味着所有 Web 开发人员都会使用它。