Is it valid to do:
<script src="//example.com/file.js" />
instead of
<script src="http://example.com/file.js" />
or
<script src="https://example.com/file.js" />
The first is given as an example in facebook’s documentation, and I’m wondering if its valid and if so, which browsers support it (all, or only the most recent, etc).
Yes, it’s valid and it works too! This is what’s called a Protocol Relative URL, which will use
http://orhttps://based on the current page protocol.