Reputation: 2790
I need to load Jquery from google repository here.
On a HTTPS enviroment, its possible? I can't test this right now, and need to know. Someone already maked it?
Upvotes: 0
Views: 53
Reputation: 328760
The URL //host/...
looks a bit odd but it's a valid relative URL: It's relative to the protocol that was used to load the rest of the document.
This nifty trick allows a HTML page to load other resources with the same protocol that was used to load itself without any JavaScript or other magic.
It's often used for pages that might be delivered with either HTTP or HTTPS. By using a protocol relative URL, the browser will not leave the security of HTTPS to load additional resources and it works with static code.
Upvotes: 1
Reputation: 887877
Yes.
If you look at the URLs they give you, you'll notice that they are protocol-relative URLs.
On HTTPS sites, those URLs will be parsed as HTTPS.
Upvotes: 3
Reputation: 1749
Yes you can. Just use the http(s) you need:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
or
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Upvotes: 1