【发布时间】:2011-12-03 08:42:38
【问题描述】:
可能重复:
Is it valid to replace with // in a <script src=“…”>?
Absolute URLs omitting the protocol (scheme) in order to preserve the one of the current page
Does using //www.example.com in Javascript chose http/https protocol automatically
我正在查看来自 facebook 的一些示例代码,我看到了:
<script src="//connect.facebook.net/en_US/all.js"></script>
他们使用// 而不是http://——这是我还不知道的花哨吗?
【问题讨论】:
-
我发誓这是一个非常有名的问题的重复,但我知道如果你搜索并找不到原始问题,因为我也找不到。
-
这篇文章回答了stackoverflow.com/questions/3583103/scheme-relative-urls的问题,但是如果你不知道搜索scheme relative URL,你就找不到它
-
@BoltClock 我知道你所说的确切问题,但我也找不到。
-
@JuanMendes:嗯,输入“javascript”加上这个问题的标题给我带来了to this answer。
-
@Ӫ_._Ӫ: 虽然这个问题真的和JS无关...
标签: html url-scheme