Is there a real reason for having JS files "included" in the end of the body versus in the head?
Except for the fact that if you have it in the head you have to check if the document is ready.
Loading JS at the end of the document.
Re: Loading JS at the end of the document.
If they are at the end they load after the HTML, meaning the browser can display the page before it has to wait for the scripts to download. If you have a lot of JS files and a slow server your load time can suffer since they have to be downloaded and processed one at a time.
That's my understanding of it anyway.
That's my understanding of it anyway.
Re: Loading JS at the end of the document.
I was looking through a bunch of frameworks and boilerplates and I didn't quite understand why they would always load it at the end.
Those frameworks and boilerplates were developed for mobile sites so I guess it makes sense to have it at the end, I should have been able to figure that out... eventually
Those frameworks and boilerplates were developed for mobile sites so I guess it makes sense to have it at the end, I should have been able to figure that out... eventually