Put scripts at the bottom of the HTML body

In most cases it is better to put the Javascript script at the very most bottom of the HTML document. It is possible inside the HTML body element.
There are only a few minor reasons against this bottom placement.

Pros

Cons

Example: Javascript placed at the HTML body bottom.


<html> 
    <body>
        // content
        <div>    
        </div>
        ...
        <script type="text/javascript" src="js/script.js"></script>
    </body>
</html>


Further links at that this topic

Yahoo! Developer Network. Best practices for speeding up your web site.

Tags:

Recent Posts:

2014
January
Ajax deep links
2013
November
Prettify Fonts
Grid loading effects
October
Random CSS3 Image Flip
WP8 sync to PC
September
XAMPP FTP configuration
August
Responsive navigation
2012
August
EBA-Image-Gallery
Google Chart Tools with JSON
2011
December
jQPrefetch Demopage
November
jQPrefetch
October
Deep linking for the masses
September
Search results for key words
August
Put scripts at the bottom
July
Incorrect meta description
March
Smart Guides
January
Slider with Ajax
Overflow hidden animated

Javascript Caching Objects

PrefetchJS.de

Caching at the Clint-Side
Share www.prefetchjs.de
© Kometschuh.de | Impressum | GitHub | Facebook |