Where to place JavaScript in an HTML file? -


say have hefty javascript file, packed down 100kb or so. file mean it’s external file linked in via <script src="...">, not pasted html itself.

where’s best place put in html?

<html> <head>     <!-- here? -->     <link rel="stylesheet" href="stylez.css" type="text/css" />     <!-- here? --> </head> <body>     <!-- here? -->     <p>all page content ...</p>     <!-- or here? --> </body> </html> 

will there functional difference between each of options?

the yahoo! exceptional performance team recommend placing scripts @ bottom of page because of way browsers download components.

of course levi's comment "just before need , no sooner" correct answer, i.e. "it depends".


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -