6

I haven't had to grab the link for awhile, but when jquery undefined errors started appearing, I noticed the url in the CDN script link was missing the leading "http:" or "https:". It obviously creates a broken link. I'm wondering if this is intentional or an error on Google's part. Any insight would be great.

Ex: <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>

Should be??: <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>

https://developers.google.com/speed/libraries/devguide

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
jp_inc
  • 345
  • 4
  • 14
  • 1
    Nope, starting with `//` just means 'grab the current protocol and prepend it to the URL'. – 11684 Feb 20 '13 at 19:28

1 Answers1

9

// will give it a realtive protocol. Meaning that if you are accessing http://example.com then the cdn link will also use http:// whereas if you are accessing https://example.com then the cdn link will use https as well.

prodigitalson
  • 60,050
  • 10
  • 100
  • 114