Skip to content

Comment on Sprockets: JavaScript dependency management and concatenation (SvN)parent

Comments

Cool, thanks for the tidbit.

I had previously been told that a JavaScript download basically halts the entire processing of the remainder of the page -- including any downloads that might occur there (CSS, images, and more JS) -- because the browser can't start parsing the rest of the page until it has interpreted the JavaScript. That's why it's best to move your JavaScript down to the bottom of the page.

Is this just the way older browsers used to behave? Are there still any restrictions like this that I should be aware of?

My rule of thumb with javascript is to put everything that is critical to page functionality right at the top and everything else as far to the bottom as I can (just before </body>), that way all your buttons/sliders and other active components will work as soon as the page is rendered and any other javascript will never hurt performance.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.