New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate protocol relative URLs #1694

Closed
wants to merge 1 commit into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+8 −39
Diff settings

Always

Just for now

deprecate protocol relative URLs

  • Loading branch information...
patrickkettner committed Apr 16, 2015
commit 045a1676c4c8cf4bdd23374b5b049507101f5043
View
@@ -145,8 +145,8 @@ using some polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/
just put it before the other scripts in the bottom of the page:
```html
<script src="//cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
View
@@ -22,7 +22,7 @@
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
View
@@ -87,7 +87,7 @@ your site, for example) then you can queue up a domain name to be prefetched.
```html
<link rel="dns-prefetch" href="//example.com">
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<link rel="dns-prefetch" href="https://ajax.googleapis.com">
```
You can use as many of these as you need, but it's best if they are all
@@ -107,7 +107,7 @@ Amazon S3:
Google APIs:
```html
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<link rel="dns-prefetch" href="https://ajax.googleapis.com">
```
Microsoft Ajax Content Delivery Network:
View
@@ -3,8 +3,6 @@ table of contents](TOC.md)
# Frequently asked questions
* [Why is the URL for jQuery without
`http`?](#why-is-the-url-for-jquery-without-http)
* [Why don't you automatically load the latest version of jQuery from the Google
CDN?](#why-dont-you-automatically-load-the-latest-version-of-jquery-from-the-google-cdn)
* [Why is the Google Analytics code at the bottom? Google recommends it be
@@ -18,35 +16,6 @@ table of contents](TOC.md)
--
### Why is the URL for jQuery without `http`?
It is because of the use of [protocol-relative
URLs](http://paulirish.com/2010/the-protocol-relative-url/).
**N.B.** If you try to view the local web page directly in the browser, the
browser will fail to load the assets specified using protocol-relative URLs
as it will attempt to fetch them from the local file system. We recommend you
use a local HTTP server to test your web pages, or a file hosting service that
allows you to preview your web pages online (e.g.
[Dropbox](https://www.dropbox.com/)).
Setting up a local HTTP server can be done using there various
[one-liners](https://gist.github.com/willurd/5720255):
* PHP 5.4.0+ by running
[`php -S localhost:8080`](https://php.net/manual/en/features.commandline.webserver.php)
from your local directory
* Python 2.x by running `python -m SimpleHTTPServer` from your local directory
* Python 3.x by running `python -m http.server` from your local directory
* Ruby 1.9.2+ by running `ruby -run -ehttpd . -p8080` from your local directory
* Node.js by installing and running either
[`static -p 8080`](https://www.npmjs.org/package/node-static)
or [`http-server -p 8080`](https://www.npmjs.org/package/http-server)
A list of more complex HTTP servers can be found
[here](misc.md#servers-and-stacks).
### Why don't you automatically load the latest version of jQuery from the Google CDN?
The [file](https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js) to which
View
@@ -145,8 +145,8 @@ using some polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/
just put it before the other scripts in the bottom of the page:
```html
<script src="//cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
View
@@ -22,7 +22,7 @@
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/{{JQUERY_VERSION}}/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/{{JQUERY_VERSION}}/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-{{JQUERY_VERSION}}.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
ProTip! Use n and p to navigate between commits in a pull request.