Alex Rivera | Logout

Should Jquery code go in header or footer?

Asked 2010-01-20T22:00:04.527
198

Where is the best place to put Jquery code (or separate Jquery file)? Will pages load faster if I put it in the footer?

Edit
Report

1 Answer

6

Most jquery code executes on document ready, which doesn't happen until the end of the page anyway. Furthermore, page rendering can be delayed by javascript parsing/execution, so it's best practice to put all javascript at the bottom of the page.

answered 2010-01-20T22:01:53.713

Your Answer