Skip to content
Permalink
Newer
Older
100644 37 lines (25 sloc) 1.32 KB
Oct 31, 2016
1
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
2
table of contents](TOC.md)
3
4
# The JavaScript
5
6
Information about the default JavaScript included in the project.
7
8
## main.js
9
10
This file can be used to contain or reference your site/app JavaScript code.
11
For larger projects, you can make use of a JavaScript module loader, like
12
[Require.js](http://requirejs.org/), to load any other scripts you need to
13
run.
14
15
## plugins.js
16
17
This file can be used to contain all your plugins, such as jQuery plugins and
18
other 3rd party scripts.
19
20
One approach is to put jQuery plugins inside of a `(function($){ ...
21
})(jQuery);` closure to make sure they're in the jQuery namespace safety
22
blanket. Read more about [jQuery plugin
23
authoring](https://learn.jquery.com/plugins/#Getting_Started).
24
25
By default the `plugins.js` file contains a small script to avoid `console`
26
errors in browsers that lack a `console`. The script will make sure that, if
27
a console method isn't available, that method will have the value of empty
28
function, thus, preventing the browser from throwing an error.
29
30
31
## vendor
32
33
This directory can be used to contain all 3rd party library code.
34
35
Minified versions of the latest jQuery and Modernizr libraries are included by
36
default. You may wish to create your own [custom Modernizr
37
build](http://www.modernizr.com/download/).
You can’t perform that action at this time.