Skip to content

Speed Tip: Number 2

by Toby Somerville on December 5th, 2010

Put all JavaScript before the closing body tag (</body>).

Why?

Putting the JavaScript at the end of the page allows the whole document structure to load before executing any JavaScript. You do this because the browser blocks any further page loading as soon as any JavaScript is encounter. The browser only continues to load the page, once the JavaScript has been downloaded and executed.

From → Speed Tips

No comments yet

Leave a Reply

You must be logged in to post a comment.