mirror of
https://github.com/h5bp/html5-boilerplate.git
synced 2026-01-10 00:18:01 -05:00
Removing jQuery (#2225)
* Removing jQuery Closes #2215 (I'll write up a super great commit message when I merge this in) Additionally, this commit updates Modernizr (I was in the gulpfile and was reminded that they just released)
This commit is contained in:
30
dist/doc/html.md
vendored
30
dist/doc/html.md
vendored
@@ -135,8 +135,6 @@ it before the other scripts in the bottom of the page:
|
||||
```html
|
||||
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.0.min.js"><\/script>')</script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
@@ -154,7 +152,33 @@ The only thing Modernizr does regarding polyfills is that the team maintains [a
|
||||
huge list of cross Browser
|
||||
polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
|
||||
|
||||
### jQuery CDN for jQuery
|
||||
### jQuery
|
||||
|
||||
As of v8.0.0 we no longer include jQuery by default. Web development has
|
||||
changed a lot since we started this project and while many millions of sites
|
||||
still use jQuery there are many sites and applications that don't. 10 years ago
|
||||
jQuery _was_ JavaScript for most developers. That's not the case any more so
|
||||
we've made the decision to remove jQuery from the project.
|
||||
|
||||
If you're interested in including it, you can easily install jQuery using the
|
||||
following command:
|
||||
|
||||
```
|
||||
npm install jQuery
|
||||
```
|
||||
|
||||
You can then copy the minified file into the `vendor` folder and add jQuery
|
||||
to the `index.html` manually.
|
||||
|
||||
For reference the last version of the snippet we used to include jQuery looked
|
||||
like the following:
|
||||
|
||||
``` html
|
||||
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.0.min.js"><\/script>')</script>
|
||||
```
|
||||
|
||||
#### jQuery CDN for jQuery
|
||||
|
||||
The jQuery CDN version of the jQuery JavaScript library is referenced towards
|
||||
the bottom of the page. A local fallback of jQuery is included for rare
|
||||
|
||||
2
dist/doc/js.md
vendored
2
dist/doc/js.md
vendored
@@ -29,7 +29,7 @@ function, thus, preventing the browser from throwing an error.
|
||||
|
||||
This directory can be used to contain all 3rd party library code.
|
||||
|
||||
Minified versions of the latest jQuery and Modernizr libraries are included by
|
||||
Our custom build of the Modernizr library is included by
|
||||
default. You may wish to create your own [custom Modernizr build with the online
|
||||
builder](https://modernizr.com/download/) or [command line
|
||||
tool](https://modernizr.com/docs#command-line-config).
|
||||
|
||||
4
dist/index.html
vendored
4
dist/index.html
vendored
@@ -21,9 +21,7 @@
|
||||
|
||||
<!-- Add your site or application content here -->
|
||||
<p>Hello world! This is HTML5 Boilerplate.</p>
|
||||
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.0.min.js"><\/script>')</script>
|
||||
<script src="js/vendor/modernizr-3.11.0.min.js"></script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
|
||||
|
||||
2
dist/js/vendor/jquery-3.5.0.min.js
vendored
2
dist/js/vendor/jquery-3.5.0.min.js
vendored
File diff suppressed because one or more lines are too long
3
dist/js/vendor/modernizr-3.10.0.min.js
vendored
3
dist/js/vendor/modernizr-3.10.0.min.js
vendored
File diff suppressed because one or more lines are too long
3
dist/js/vendor/modernizr-3.11.0.min.js
vendored
Normal file
3
dist/js/vendor/modernizr-3.11.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user