Possible Duplicate:
Is it valid to replace http:// with // in a <script src=“http://…”>?
我刚刚看到//sub.sitename.com/thing/
在一个网址中。这是标准吗?我认为它在访问其他站点时会保留该方案(http 与 https),但我不知道。这是标准吗?还是 html 世界中的罪恶?
最佳答案
答案是肯定的,这是由RFC 3986标准化的§ 4.2:
A relative reference takes advantage of the hierarchical syntax (Section 1.2.3) to express a URI reference relative to the name space of another hierarchical URI.
[...]
A relative reference that begins with two slash characters is termed a network-path reference; such references are rarely used.
关于html - 是//sub.sitename.com/thing/standard 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14669243/