Javascript src starts with //?
- by Chris
I'm starting to see more and more script references show up like so:
<script type="text/javascript" src="//somedomain.com/somescript.js"></script>
Note the lack of http: at the beginning of the src attribute.
It seems to work fine and avoids the messy requirement of detecting http vs https, but I've never actually seen this uri format referenced anywhere. Where did it come from? Is this behavior documented anywhere? Is it guaranteed to work in any browser?