I see that the src
URL for jQuery has no protocol specified:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
<script>
Is this standard? What are the pros and cons of leaving out the protocol?
I see that the src
URL for jQuery has no protocol specified:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.1/jquery.min.js"></script>
<script>
Is this standard? What are the pros and cons of leaving out the protocol?
It's a shorthand. It'll use whatever protocol the current source is using without having to state it explicitly and avoiding possible mixed content warnings.
See the RFC, sections 3 and 4.2