<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Where to include JavaScript files in a document</title>
	<atom:link href="http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/</link>
	<description>Web development and Internet trends</description>
	<pubDate>Thu, 20 Nov 2008 11:07:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Sam</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470250</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 05 Nov 2008 13:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470250</guid>
		<description>exacly how flash AS has been optimized.   with AS3 you can now only import classes that are needed. the same principle sould be used with larger JS libraries.</description>
		<content:encoded><![CDATA[<p>exacly how flash AS has been optimized.   with AS3 you can now only import classes that are needed. the same principle sould be used with larger JS libraries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470245</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 05 Nov 2008 13:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470245</guid>
		<description>you can also use javascript to include other JS. with an if statment, and  include by document.write concating the include w/two strings.</description>
		<content:encoded><![CDATA[<p>you can also use javascript to include other JS. with an if statment, and  include by document.write concating the include w/two strings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470243</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 05 Nov 2008 13:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470243</guid>
		<description>to add to that.  I know what someone is going to say already.  the dom will not be ready until the body loads -

instead of a complete dom-ready - use a targeted tag id or on load function not on the body can be an image or whatever to call the function.

also note that you can have JS includes anywhere in the document apply them as needed.

note: The header JS will only be slower on initial page load after it's been cached, it's faster to have it in the header.  So it would be ideal to have 'some' script in the header section.  

as always with these type of 'what is better answers' - it depends on the app/ page itself.</description>
		<content:encoded><![CDATA[<p>to add to that.  I know what someone is going to say already.  the <acronym title="Document Object Model">DOM</acronym> will not be ready until the body loads -</p>
<p>instead of a complete <acronym title="Document Object Model">DOM</acronym>-ready - use a targeted tag id or on load function not on the body can be an image or whatever to call the function.</p>
<p>also note that you can have JS includes anywhere in the document apply them as needed.</p>
<p>note: The header JS will only be slower on initial page load after it&#8217;s been cached, it&#8217;s faster to have it in the header.  So it would be ideal to have &#8217;some&#8217; script in the header section.  </p>
<p>as always with these type of &#8216;what is better answers&#8217; - it depends on the app/ page itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470239</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 05 Nov 2008 12:45:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-470239</guid>
		<description>If you are looking for a definitive answer in which is better then you would be mistaken by doing so.
 
The correct answer is to use JavaScript in the header and includes inside the document and sometimes both.

In the header initialize variables and functions that are essential for initial layout, 
and only the ‘basic’ page functionality for your application.  There are dom-ready scripts that work.

The problem is that so many are trying to use these giant JS libraries. 
These libraries for building RIAs are far from optimal and not nearly as modular as they should be.  I would think best practice would be to include JS files as needed through out the document in the form of progressive loading and progressive execution. Only including the parts that are needed for the current loaded content, and interchanging loading XHTML and JavaScript only as it is needed.</description>
		<content:encoded><![CDATA[<p>If you are looking for a definitive answer in which is better then you would be mistaken by doing so.</p>
<p>The correct answer is to use JavaScript in the header and includes inside the document and sometimes both.</p>
<p>In the header initialize variables and functions that are essential for initial layout,<br />
and only the ‘basic’ page functionality for your application.  There are <acronym title="Document Object Model">DOM</acronym>-ready scripts that work.</p>
<p>The problem is that so many are trying to use these giant JS libraries.<br />
These libraries for building RIAs are far from optimal and not nearly as modular as they should be.  I would think best practice would be to include JS files as needed through out the document in the form of progressive loading and progressive execution. Only including the parts that are needed for the current loaded content, and interchanging loading <acronym title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym> and JavaScript only as it is needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-410330</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 08 Sep 2008 01:08:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-410330</guid>
		<description>I like the js at the bottom of the document. I don't know if this is kosher, but it works even if you put if OUTSIDE of the closing </description>
		<content:encoded><![CDATA[<p>I like the js at the bottom of the document. I don&#8217;t know if this is kosher, but it works even if you put if OUTSIDE of the closing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-258400</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Sat, 26 Apr 2008 22:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-258400</guid>
		<description>Andreas,

Yes, statistics scripts should always be at the bottom, no matter what.

Morgan

Thanks for the tip! Interesting tool!

Diego,

Event delegation can be a good solution, and is in general the way to work with events. However, just as you say, many times people use a JavaScript library to apply events, and then that library need to be included before the event is applied anyway (unless one uses separate code for applying just that specific event, but then in turn, you have multiple places and ways to handle events, which isn't good either).

So, I'm just not sure it's the best solution either. It's tough shit finding a good solution here. :-)

When it comes to event delegation (and your IEContentLoaded solution and &lt;code&gt;doScroll&lt;/code&gt;, which is funky stuff :-) ), I know you have good code and ideas. I guess it all depends on what level you want to take event delegation too, but in general I do propose to people to have an event on the containing element, and then work with what element was the actual target.

Outtanames999,

To be honest, I don't really know about their Flash files, but when it comes to HTML, CSS and JavaScript, I personally think their research has lead to a lot of great advice and practices.</description>
		<content:encoded><![CDATA[<p>Andreas,</p>
<p>Yes, statistics scripts should always be at the bottom, no matter what.</p>
<p>Morgan</p>
<p>Thanks for the tip! Interesting tool!</p>
<p>Diego,</p>
<p>Event delegation can be a good solution, and is in general the way to work with events. However, just as you say, many times people use a JavaScript library to apply events, and then that library need to be included before the event is applied anyway (unless one uses separate code for applying just that specific event, but then in turn, you have multiple places and ways to handle events, which isn&#8217;t good either).</p>
<p>So, I&#8217;m just not sure it&#8217;s the best solution either. It&#8217;s tough shit finding a good solution here. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>When it comes to event delegation (and your IEContentLoaded solution and <code>doScroll</code>, which is funky stuff <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ), I know you have good code and ideas. I guess it all depends on what level you want to take event delegation too, but in general I do propose to people to have an event on the containing element, and then work with what element was the actual target.</p>
<p>Outtanames999,</p>
<p>To be honest, I don&#8217;t really know about their Flash files, but when it comes to <acronym title="HyperText Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym> and JavaScript, I personally think their research has lead to a lot of great advice and practices.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Outtanames999</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-258124</link>
		<dc:creator>Outtanames999</dc:creator>
		<pubDate>Sat, 26 Apr 2008 16:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-258124</guid>
		<description>I wouldn't look to Yahoo for best practices on page loads - they've got the slowest pages on the net!

In spite of the great deal of attention they have paid to optimizing HTML and JS and PHP, they are at the mercy of bloated Flash files and no amount of code text optimization can possibly counteract that, which Yahoo has all but admitted.</description>
		<content:encoded><![CDATA[<p>I wouldn&#8217;t look to Yahoo for best practices on page loads - they&#8217;ve got the slowest pages on the net!</p>
<p>In spite of the great deal of attention they have paid to optimizing <acronym title="HyperText Markup Language">HTML</acronym> and JS and <acronym title="Hypertext PreProcessing">PHP</acronym>, they are at the mercy of bloated Flash files and no amount of code text optimization can possibly counteract that, which Yahoo has all but admitted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego Perini</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-257479</link>
		<dc:creator>Diego Perini</dc:creator>
		<pubDate>Sat, 26 Apr 2008 01:15:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-257479</guid>
		<description>I personally put scripts in the head section as for specs but the comments above depict other situation for preferring this.

Anyway the best pratice for the "clicked to early" problem is to use event delegation, this allows avoiding to wait for an "onload" event so the event can be added as soon as
the script starts (dynamically bound to new elements as they enter the DOM).

As a last resort if I have to wait for the entire HTML to be completely loaded I use my "ContentLoaded.js" to correctly handle the missing method for IE. The "doScroll('left')" trick for IE is great for these situations.

There may be scripts that can be loaded later through asynchronous "lazy loading" if the complete framework is too big. This may also be a reason to load all the pieces at the time they are needed. However a core script is necessary in the head to allow for "early page enlivenment" and to let the users click on buttons as soon as they see them appear.

Robert you may have a look at my lab site for "Event Delegates" you may be tempted to add something like that to your powerful DomAssistant, sources are on Google Code.

Diego Perini</description>
		<content:encoded><![CDATA[<p>I personally put scripts in the head section as for specs but the comments above depict other situation for preferring this.</p>
<p>Anyway the best pratice for the &#8220;clicked to early&#8221; problem is to use event delegation, this allows avoiding to wait for an &#8220;onload&#8221; event so the event can be added as soon as<br />
the script starts (dynamically bound to new elements as they enter the <acronym title="Document Object Model">DOM</acronym>).</p>
<p>As a last resort if I have to wait for the entire <acronym title="HyperText Markup Language">HTML</acronym> to be completely loaded I use my &#8220;ContentLoaded.js&#8221; to correctly handle the missing method for <acronym title="Internet Explorer">IE</acronym>. The &#8220;doScroll(&#8217;left&#8217;)&#8221; trick for <acronym title="Internet Explorer">IE</acronym> is great for these situations.</p>
<p>There may be scripts that can be loaded later through asynchronous &#8220;lazy loading&#8221; if the complete framework is too big. This may also be a reason to load all the pieces at the time they are needed. However a core script is necessary in the head to allow for &#8220;early page enlivenment&#8221; and to let the users click on buttons as soon as they see them appear.</p>
<p>Robert you may have a look at my lab site for &#8220;Event Delegates&#8221; you may be tempted to add something like that to your powerful DomAssistant, sources are on Google Code.</p>
<p>Diego Perini</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morgan Roderick</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-257258</link>
		<dc:creator>Morgan Roderick</dc:creator>
		<pubDate>Fri, 25 Apr 2008 19:14:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-257258</guid>
		<description>Or you could just test it out yourself, with your favourite browsers at:

http://stevesouders.com/cuzillion/

My new favourite tool :D</description>
		<content:encoded><![CDATA[<p>Or you could just test it out yourself, with your favourite browsers at:</p>
<p><a href="http://stevesouders.com/cuzillion/" rel="nofollow">http://stevesouders.com/cuzillion/</a></p>
<p>My new favourite tool <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Rydberg</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256964</link>
		<dc:creator>Andreas Rydberg</dc:creator>
		<pubDate>Fri, 25 Apr 2008 11:04:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256964</guid>
		<description>I haven't read all the other comments, so I might be repeating some things that other said.

I've looked at many of the videos from Yahoo Developer's area. And they contridict themselves somewhat. But one should not blindly go with one side or the other, just use common sense is my advice.

In one video the guy said that splitting large Javascript-files into smaller logical parts. This would make the browsing experience better, because the user don't need to download a lot of code that is useless on the current page.

In the next video another guy said that you should put everything in one large file, causing less HTTP-requests.

Personally, I use both, depending on situation and where it's logical to have bigger or smaller files.

To stay on topic I usually put most scripts in the head, but when I can put them in the bottom of document - I do it. Specially if you use Google Analytics and similar on your site/app, they can make pages halt for several seconds.

One other thing; if you have scripts in smaller parts and you have a start page (after user logs in), then you can preload scripts by putting them in the bottom of the document.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t read all the other comments, so I might be repeating some things that other said.</p>
<p>I&#8217;ve looked at many of the videos from Yahoo Developer&#8217;s area. And they contridict themselves somewhat. But one should not blindly go with one side or the other, just use common sense is my advice.</p>
<p>In one video the guy said that splitting large Javascript-files into smaller logical parts. This would make the browsing experience better, because the user don&#8217;t need to download a lot of code that is useless on the current page.</p>
<p>In the next video another guy said that you should put everything in one large file, causing less <acronym title="HyperText Transfer Protocol">HTTP</acronym>-requests.</p>
<p>Personally, I use both, depending on situation and where it&#8217;s logical to have bigger or smaller files.</p>
<p>To stay on topic I usually put most scripts in the head, but when I can put them in the bottom of document - I do it. Specially if you use Google Analytics and similar on your site/app, they can make pages halt for several seconds.</p>
<p>One other thing; if you have scripts in smaller parts and you have a start page (after user logs in), then you can preload scripts by putting them in the bottom of the document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256899</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Fri, 25 Apr 2008 09:19:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256899</guid>
		<description>Thanks for great comments! Apparently there are many aspects to this, and no one-solution-fits-all is out there. And for high-performance web sites, NICCAI and Remy, with the &lt;code&gt;earlyClickHandler&lt;/code&gt; solution, pose interesting ideas which aren't best practice, but rather about actually making things work the best way they can in real life.

Alternative cases might be sufficiently efficient if you compress all your JavaScript files into one, compress them and gzip them, and then include them in the &lt;code&gt;head&lt;/code&gt; part of the document.

Paul, André,

I'm glad you liked the references in the post... :-)</description>
		<content:encoded><![CDATA[<p>Thanks for great comments! Apparently there are many aspects to this, and no one-solution-fits-all is out there. And for high-performance web sites, NICCAI and Remy, with the <code>earlyClickHandler</code> solution, pose interesting ideas which aren&#8217;t best practice, but rather about actually making things work the best way they can in real life.</p>
<p>Alternative cases might be sufficiently efficient if you compress all your JavaScript files into one, compress them and gzip them, and then include them in the <code>head</code> part of the document.</p>
<p>Paul, André,</p>
<p>I&#8217;m glad you liked the references in the post&#8230; <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tino Zijdel</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256798</link>
		<dc:creator>Tino Zijdel</dc:creator>
		<pubDate>Fri, 25 Apr 2008 06:49:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256798</guid>
		<description>Head, definitely. I want to apply JS behaviour as soon as possible to avoid confusing users with different behaviour when the page is not fully loaded so I use inline functioncalls right after the sections the behaviour should be applied to. Some people might call that a sin in itself but obviously they have never created a large website themselves...

Splitting up the JS functions into a file that is necessary beforehand and one that can be loaded afterwards only results in an extra HTTP request on first hit so is also less than optimal.

As for JS optimization: we use HTTP compression and are considering minification although that will only squeeze an insignificant extra bytes out of the size on the wire. Using f.i. Dean's packer is far less optimal and requires the client to 'unpack' the contents on every pageview which is actually more of a performance drain than a gain.</description>
		<content:encoded><![CDATA[<p>Head, definitely. I want to apply JS behaviour as soon as possible to avoid confusing users with different behaviour when the page is not fully loaded so I use inline functioncalls right after the sections the behaviour should be applied to. Some people might call that a sin in itself but obviously they have never created a large website themselves&#8230;</p>
<p>Splitting up the JS functions into a file that is necessary beforehand and one that can be loaded afterwards only results in an extra <acronym title="HyperText Transfer Protocol">HTTP</acronym> request on first hit so is also less than optimal.</p>
<p>As for JS optimization: we use <acronym title="HyperText Transfer Protocol">HTTP</acronym> compression and are considering minification although that will only squeeze an insignificant extra bytes out of the size on the wire. Using f.i. Dean&#8217;s packer is far less optimal and requires the client to &#8216;unpack&#8217; the contents on every pageview which is actually more of a performance drain than a gain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remy Sharp</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256606</link>
		<dc:creator>Remy Sharp</dc:creator>
		<pubDate>Thu, 24 Apr 2008 21:47:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256606</guid>
		<description>@Andrea - I specifically apply the onclick (nasty, but only used in desperate situations) on the links that should hook JS actions that I knew were required. i.e. there were only a couple of links that absolutely had to have the event handler.</description>
		<content:encoded><![CDATA[<p>@Andrea - I specifically apply the onclick (nasty, but only used in desperate situations) on the links that should hook JS actions that I knew were required. i.e. there were only a couple of links that absolutely had to have the event handler.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdmadph</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256541</link>
		<dc:creator>mdmadph</dc:creator>
		<pubDate>Thu, 24 Apr 2008 19:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256541</guid>
		<description>Why, just put all your scripts at the bottom, but have a big, opaque &#60; div &#62; covering the entire page with a "loading" gif in it.  Then, when your initial scripts are done, fade it out and show the HTML content.

I've found this works particularly well for web applications, since users are most likely already used to having a loading screen while waiting for an application to load.  You can even get fancy and update the loading"screen with relevant information, like a progress bar.</description>
		<content:encoded><![CDATA[<p>Why, just put all your scripts at the bottom, but have a big, opaque &lt; div &gt; covering the entire page with a &#8220;loading&#8221; gif in it.  Then, when your initial scripts are done, fade it out and show the <acronym title="HyperText Markup Language">HTML</acronym> content.</p>
<p>I&#8217;ve found this works particularly well for web applications, since users are most likely already used to having a loading screen while waiting for an application to load.  You can even get fancy and update the loading&#8221;screen with relevant information, like a progress bar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jens Meiert</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256510</link>
		<dc:creator>Jens Meiert</dc:creator>
		<pubDate>Thu, 24 Apr 2008 18:16:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256510</guid>
		<description>The only important reason to put scripts at the end of a file appears to be missing, namely to avoid “invalid” numbers (statistics). IIRC, putting analytics scripts at the end “ensures” that the page is really loaded and that it can be considered a valid page view (otherwise, users cancelling or going back could be counted w/o actually seeing the entire document).</description>
		<content:encoded><![CDATA[<p>The only important reason to put scripts at the end of a file appears to be missing, namely to avoid “invalid” numbers (statistics). <acronym title="if I remember correctly">IIRC</acronym>, putting analytics scripts at the end “ensures” that the page is really loaded and that it can be considered a valid page view (otherwise, users cancelling or going back could be counted w/o actually seeing the entire document).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André Luís</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256380</link>
		<dc:creator>André Luís</dc:creator>
		<pubDate>Thu, 24 Apr 2008 15:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256380</guid>
		<description>"Getting head"!!!! baaaaaahahahahahhahahaha LMFAO!!!!

You, Rob, are definitely THE Rockstar!!! :D</description>
		<content:encoded><![CDATA[<p>&#8220;Getting head&#8221;!!!! baaaaaahahahahahhahahaha LMFAO!!!!</p>
<p>You, Rob, are definitely THE Rockstar!!! <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256348</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Thu, 24 Apr 2008 14:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256348</guid>
		<description>@Andrea - I don't use noscript, i use progressive enhancement. The site will function properly with or without JS.

Also, you _should_ put noscript-elements in the body-element. Otherwise no-one will ever see the contents of them.</description>
		<content:encoded><![CDATA[<p>@Andrea - I don&#8217;t use noscript, i use progressive enhancement. The site will function properly with or without JS.</p>
<p>Also, you _should_ put noscript-elements in the body-element. Otherwise no-one will ever see the contents of them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256342</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 24 Apr 2008 14:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256342</guid>
		<description>I used to put scripts at the bottom, but moved them back to the head recently.

Reason being, I was using &lt;a href="http://code.google.com/p/swfobject/" rel="nofollow"&gt;swfobject&lt;/a&gt; to write a flash movie into the page and it looked awkward for the whole page to load with a ugly bare content area that was going to be replaced by the swf.</description>
		<content:encoded><![CDATA[<p>I used to put scripts at the bottom, but moved them back to the head recently.</p>
<p>Reason being, I was using <a href="http://code.google.com/p/swfobject/" rel="nofollow">swfobject</a> to write a flash movie into the page and it looked awkward for the whole page to load with a ugly bare content area that was going to be replaced by the swf.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256326</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Thu, 24 Apr 2008 13:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256326</guid>
		<description>@Andreas, but shouldn't you put a noscript after every script?
I am talking about accessibility specs and graceful enhancement, because if your page works only with JS, it does not make sense to show content before JS is usable, imho, user has to wait in both cases for responsiveness.

P.S. Dean's packer is not exactly what I was talking about when I said optimized :)</description>
		<content:encoded><![CDATA[<p>@Andreas, but shouldn&#8217;t you put a noscript after every script?<br />
I am talking about accessibility specs and graceful enhancement, because if your page works only with JS, it does not make sense to show content before JS is usable, imho, user has to wait in both cases for responsiveness.</p>
<p>P.S. Dean&#8217;s packer is not exactly what I was talking about when I said optimized <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrea Giammarchi</title>
		<link>http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256319</link>
		<dc:creator>Andrea Giammarchi</dc:creator>
		<pubDate>Thu, 24 Apr 2008 13:32:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2008/04/23/where-to-include-javascript-files-in-a-document/#comment-256319</guid>
		<description>Interesting Remy, so why don't you separe everything using script tag in the bottom, before others, and a simple snippet like this one?
&lt;code&gt;
&#60;script type="text/javascript"&#62;(function(){
for(var
	a = document.getElementsByTagName("a"),
	l = a.length;
	l--;
	a[l].onclick = earlyClickHandler
);
})();&#60;/script&#62;
&lt;/code&gt;
In this case you won't have onclick in layout, so page load until above code will be even faster, if you're using a lot of links. Am I wrong?</description>
		<content:encoded><![CDATA[<p>Interesting Remy, so why don&#8217;t you separe everything using script tag in the bottom, before others, and a simple snippet like this one?<br />
<code><br />
&lt;script type="text/javascript"&gt;(function(){<br />
for(var<br />
	a = document.getElementsByTagName("a"),<br />
	l = a.length;<br />
	l--;<br />
	a[l].onclick = earlyClickHandler<br />
);<br />
})();&lt;/script&gt;<br />
</code><br />
In this case you won&#8217;t have onclick in layout, so page load until above code will be even faster, if you&#8217;re using a lot of links. Am I wrong?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
