Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to Front End Performance Optimization!
You have completed Introduction to Front End Performance Optimization!
Preview
Making adjustments to when JavaScript is loaded can dramatically improve perceived performance. In this case, the page will still take the same total amount of time to load, but it will appear to load faster to the end user.
Concepts
- Load JavaScript at the Bottom - In general, a JavaScript file will block any further rendering until the JavaScript has finished being loaded and parsed.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
But, for now, we're just going to take a
few basic steps in our
0:00
HTML that will improve performance right
away.
0:00
First, we should try to load JavaScript at
the bottom of our document.
0:03
This is not always possible, and some
JavaScript libraries and
0:08
frameworks don't allow for it, so be sure
to read the documentation.
0:11
However, with jQuery and its plugins,
which are only designed to enhance a page,
0:16
we can most definitely load it at the
bottom.
0:22
The reason we want to move our scripts to
the bottom has both a simple explanation
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up