1

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?

unor
  • 92,415
  • 26
  • 211
  • 360
Clay Nichols
  • 11,848
  • 30
  • 109
  • 170

1 Answers1

0

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

Community
  • 1
  • 1
msg
  • 7,863
  • 3
  • 14
  • 33