Question

There is a similar question that has an accepted answer, but the link it refers to is no longer available (not even on the wayback machine). The H5BP docs themselves are not very specific on this subject (here), at least not for a noob like me. And the answer to this similar question still doesn't explain much to me. It sort of touches on how to use plugins.js, but isn't very specific and doesn't explain main.js.

Unfortunately, these are the only bits of information I could find, and I still don't really understand what these files are for. So can anyone explain;

How do I use main.js and plugins.js from the HTML5 boilerplate?

What is their function, how would I use them?

Was it helpful?

Solution

It's just suggested organization.

The idea is to drop jQuery plugins you're using into plugins.js and (depending on the size of the site) do your work in main.js.

I wrote it up in detail in the Isboar standards docs (although that doc refers to scripts.js and not main.js)

OTHER TIPS

plugins.js is to put all your vendor scripts (not authored by you), in a single file. You may have tooltio.1.4.js or tablular.min.js or d3.vert.js - and instead of using all these JS files directly into HTML page, you copy paste all codes into plugins.js

Main.js is just a template file given to you for your own authored codes.

You should refer to h5bp's other repos'. Check this out https://github.com/h5bp/html5boilerplate.com/blob/master/src/js/main.js

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top