0

I'm seeing these kind of script includes on third party sites all the time these days, for example, for the Google Maps API:

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=false"></script>

What does this prefix of '//' mean ? That it uses whatever protocol the user is running (http, https)?

Niklas9
  • 8,816
  • 8
  • 37
  • 60
  • Look at these questions: http://stackoverflow.com/questions/6785442/browser-support-for-urls-beginning-with-double-slash, http://stackoverflow.com/questions/6350244/double-slash-at-beginning-of-javascript-include, http://stackoverflow.com/questions/9646407/two-forward-slashes-in-a-url-src-href-attribute – Alberto Zaccagni May 18 '13 at 10:05

1 Answers1

1

Yes, It means use the same protocol as was used to load the page - either http or https

This is done so that you don't get a warning about loading "insecure" content when viewing over SSL

Basic
  • 26,321
  • 24
  • 115
  • 201