<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The proper way to include Javascript in your (X)HTML page</title>
	<atom:link href="http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/feed/" rel="self" type="application/rss+xml" />
	<link>http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/</link>
	<description>On life, web dev and everything in between.</description>
	<lastBuildDate>Wed, 25 Aug 2010 17:14:29 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mislav</title>
		<link>http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/comment-page-1/#comment-30</link>
		<dc:creator>Mislav</dc:creator>
		<pubDate>Thu, 31 Jan 2008 14:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/#comment-30</guid>
		<description>Yeah, the whole mime-type thing with JavaScript blows. That&#039;s why we&#039;re forced to use this &quot;beautiful&quot; regexp in Prototype lib: &lt;code&gt;contentType.match(/^\s*(text&#124;application)\/(x-)?(java&#124;ecma)script(;.*)?\s*$/i)&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Yeah, the whole mime-type thing with JavaScript blows. That&#8217;s why we&#8217;re forced to use this &#8220;beautiful&#8221; regexp in Prototype lib: <code>contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zytzagoo</title>
		<link>http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/comment-page-1/#comment-23</link>
		<dc:creator>zytzagoo</dc:creator>
		<pubDate>Wed, 30 Jan 2008 08:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/#comment-23</guid>
		<description>While it is true the w3c recommendations &lt;em&gt;currently&lt;/em&gt; state it&#039;s required, the current implementations (for all practical use cases) are essentially ignoring it. 
The fact that the xhtml recommendations date back to 2002 (xhtml) and 1999 (html 4) ain&#039;t helping much either.

Another thing is that the &lt;em&gt;text/javascript&lt;/em&gt; &quot;mime-type&quot; (media type?) has been proposed for obsoletion (according to &lt;a href=&quot;http://www.rfc-editor.org/rfc/rfc4329.txt&quot; rel=&quot;nofollow&quot;&gt;RFC 4329&lt;/a&gt;),
and the HTML 5 working draft says that mime-types should be defined with accordance to &lt;a href=&quot;http://www.rfc-editor.org/rfc/rfc2046.txt&quot; rel=&quot;nofollow&quot;&gt;RFC 2046&lt;/a&gt; which is a bit ambiguous about whether to use text/something or application/something. But that&#039;ll be sorted out hopefully.

What &quot;hit the nail on the type coffin&quot; for me was reading the current working draft for HTML 5 and seeing this: http://www.w3.org/TR/2008/WD-html5-20080122/#the-scripts
Step 1. clearly states that the default is javascript. 
They&#039;re doing it like that because all the browser vendors already have it implemented that way. Which makes my code in the post work flawlessly and even future-proof so far :)

BTW, I find it amusing that the same document lists ECMAscript as the supported scripting language&#039;s name, and yet they&#039;re still using text/javascript as the mime-type attribute... 

Validation and standards are nice to have. But they&#039;re not the &quot;highest of all causes&quot;. And they&#039;re sometimes downright impossible to achieve while still giving the client (or the boss, or whatever) what he reasonably wants (that can very well be the topic of a whole different article). Pragmatists just sleep better :)</description>
		<content:encoded><![CDATA[<p>While it is true the w3c recommendations <em>currently</em> state it&#8217;s required, the current implementations (for all practical use cases) are essentially ignoring it.<br />
The fact that the xhtml recommendations date back to 2002 (xhtml) and 1999 (html 4) ain&#8217;t helping much either.</p>
<p>Another thing is that the <em>text/javascript</em> &#8220;mime-type&#8221; (media type?) has been proposed for obsoletion (according to <a href="http://www.rfc-editor.org/rfc/rfc4329.txt" rel="nofollow">RFC 4329</a>),<br />
and the HTML 5 working draft says that mime-types should be defined with accordance to <a href="http://www.rfc-editor.org/rfc/rfc2046.txt" rel="nofollow">RFC 2046</a> which is a bit ambiguous about whether to use text/something or application/something. But that&#8217;ll be sorted out hopefully.</p>
<p>What &#8220;hit the nail on the type coffin&#8221; for me was reading the current working draft for HTML 5 and seeing this: <a href="http://www.w3.org/TR/2008/WD-html5-20080122/#the-scripts" rel="nofollow">http://www.w3.org/TR/2008/WD-html5-20080122/#the-scripts</a><br />
Step 1. clearly states that the default is javascript.<br />
They&#8217;re doing it like that because all the browser vendors already have it implemented that way. Which makes my code in the post work flawlessly and even future-proof so far :)</p>
<p>BTW, I find it amusing that the same document lists ECMAscript as the supported scripting language&#8217;s name, and yet they&#8217;re still using text/javascript as the mime-type attribute&#8230; </p>
<p>Validation and standards are nice to have. But they&#8217;re not the &#8220;highest of all causes&#8221;. And they&#8217;re sometimes downright impossible to achieve while still giving the client (or the boss, or whatever) what he reasonably wants (that can very well be the topic of a whole different article). Pragmatists just sleep better :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mislav</title>
		<link>http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/comment-page-1/#comment-22</link>
		<dc:creator>Mislav</dc:creator>
		<pubDate>Wed, 30 Jan 2008 00:32:07 +0000</pubDate>
		<guid isPermaLink="false">http://zytzagoo.net/blog/2008/01/29/the-proper-way-to-include-javascript-in-your-xhtml-page/#comment-22</guid>
		<description>It&#039;s 2008. XHTML became a W3C recommendation 8 years ago, which was just enough time for anyone to check the spec and see that the &lt;code&gt;type&lt;/code&gt; attribute really &lt;em&gt;is&lt;/em&gt; required. It is so in XHTML 1.0 both Transitional and Strict, and it was so in HTML 4.</description>
		<content:encoded><![CDATA[<p>It&#8217;s 2008. XHTML became a W3C recommendation 8 years ago, which was just enough time for anyone to check the spec and see that the <code>type</code> attribute really <em>is</em> required. It is so in XHTML 1.0 both Transitional and Strict, and it was so in HTML 4.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
