<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ajaxian</title>
	<atom:link href="http://ajaxian.com/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 18 Mar 2010 15:37:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RequireJS: Asynchronous JavaScript loading</title>
		<link>http://ajaxian.com/archives/requirejs-asynchronous-javascript-loading</link>
		<comments>http://ajaxian.com/archives/requirejs-asynchronous-javascript-loading#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:15:12 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8730</guid>
		<description><![CDATA[A certain someone was talking to me about how they find it interesting that node.js, the JavaScript server framework du jour which loves all things async, starts life with a bunch of synchronous require() calls. Now, this is actually quite fine since the startup of the server is not the issue at hand.
However, if you [...]]]></description>
			<content:encoded><![CDATA[<p>A certain someone was talking to me about how they find it interesting that node.js, the JavaScript server framework du jour which loves all things async, starts life with a bunch of synchronous <code>require()</code> calls. Now, this is actually quite fine since the startup of the server is not the issue at hand.</p>
<p>However, if you are running <code>require()</code>-esque loader code in the browser you want to avoid blocking calls else Steve Souders will come over and beat you up.</p>
<p>I have seen a couple of interesting items in this area:</p>
<p><b>RequireJS</b></p>
<p>James Burke of Mozilla Messaging has spent a lot of time in the depths of <code>dojo.require()</code>. He has taken another look at the problem and <a href="http://requirejs.org/">RequireJS</a> a solution that offers:</p>
<ul>
<li>some sort of #include/import/require</li>
<li>ability to load nested dependencies</li>
<li>ease of use for developer but then backed by an optimization tool that helps deployment
</li>
</ul>
<p>He <a href="http://requirejs.org/docs/why.html">walks through the problem</a> and why other solutions like LABjs, CommonJS require, and Dojo itself don't cover all of his bases.</p>
<p>The end result is:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-2');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// code that runs asynchronously when the library is loaded</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">"some/script.js"</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//This function is called after some/script.js has loaded.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// defining the module and dependencies</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">require.<span style="color: #006600;">def</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// The name of this module</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"types/Manager"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// The array of dependencies</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">"types/Employee"</span><span style="color:#006600; font-weight:bold;">&#93;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// The function to execute when all dependencies have loaded. The arguments</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// to this function are the array of dependencies mentioned above.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>Employee<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> Manager <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">reports</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// This will now work</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Manager.<span style="color: #006600;">prototype</span> = <span style="color: #003366; font-weight: bold;">new</span> Employee<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// return the Manager constructor function so it can be used by other modules.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> Manager;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><b>Google Analytics "async add to []" Pattern</b></p>
<p>When talking to Davis Frank of Pivotal about some Google Analytics code, he pointed me to <a href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">details about the new GA asynchronous loader</a> that we very <a href="/archives/google-analytics-unblocks-the-web-w-async-support">excitedly blogged about</a> since GA was such a blocking offender on the Web.</p>
<p>Part of the asynchronous API is that you, the developer create an array, and use the <code>push()</code> method to put commands on a queue. This means that you can start pushing commands immediately.</p>
<p>Then, when the GA code loads asynchronously, it takes over that array and wraps those standard methods. Now it can take the commands and fire them back to GA and <code>push()</code> can do more. Freaking brilliant.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/requirejs-asynchronous-javascript-loading/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A typeface created in CSS</title>
		<link>http://ajaxian.com/archives/a-typeface-created-in-css</link>
		<comments>http://ajaxian.com/archives/a-typeface-created-in-css#comments</comments>
		<pubDate>Wed, 17 Mar 2010 13:17:21 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8727</guid>
		<description><![CDATA[
David Desandro has developed a newtypeface family named Curtis and done so in an interesting way.... using CSS:

Each character is wrapped in a &#60;span&#62; and then depending on the complexity of that character, more empty &#60;span&#62; elements are added to the markup to render each shape. Here's the markup for R:
PLAIN TEXT
HTML:




&#160;


&#60;span class="css_char r"&#62;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ajaxian.com/wp-content/images/curtis-r.png" alt="curtis-r" title="curtis-r" width="360" height="280" class="alignnone size-full wp-image-8728"/></p>
<p>David Desandro has <a href="http://desandro.com/resources/curtis-css-typeface/">developed a newtypeface family named Curtis</a> and done so in an interesting way.... using CSS:</p>
<blockquote><p>
Each character is wrapped in a &lt;span&gt; and then depending on the complexity of that character, more empty &lt;span&gt; elements are added to the markup to render each shape. Here's the markup for R:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-4');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-4">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"css_char r"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; R</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"inside split_vert"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"outside split_vert"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"stroke"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"fill"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>The Curtis CSS font wasn’t conceived of any practical application. I was more interested in seeing if it could be pulled off, and if so, what the final result would look like.
</p></blockquote>
<p>Fun and crazy!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/a-typeface-created-in-css/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Hot Apps: Using $1M to reward 440 mobile Web developers</title>
		<link>http://ajaxian.com/archives/hot-apps-using-1m-to-reward-440-mobile-web-developers</link>
		<comments>http://ajaxian.com/archives/hot-apps-using-1m-to-reward-440-mobile-web-developers#comments</comments>
		<pubDate>Wed, 17 Mar 2010 11:22:03 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8739</guid>
		<description><![CDATA[
Disclaimer: Ben and I work for Palm and created this program. I wanted to make sure that you were aware of it over here, since Web developers have a great chance of getting some $ :)
At Palm we wanted to reward the mobile Web developers who build great applications that our users can enjoy. We [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://developer.palm.com/images/palm/hot_feature2.png" style="float:right; padding:6px"/></p>
<p><em>Disclaimer: Ben and I work for Palm and created this program. I wanted to make sure that you were aware of it over here, since Web developers have a great chance of getting some $ :)</em></p>
<p>At Palm we wanted to reward the mobile Web developers who build great applications that our users can enjoy. We didn't want to do an "Mobile App Idol". For one, I didn't want to play the role of Simon (being the token Brit and all), and for two we find it hard to judge correctly.</p>
<p>So, we came up with the <a href="http://developer.palm.com/index.php?option=com_content&#038;view=article&#038;id=1841&#038;Itemid=35">Hot Apps</a> program that rewards based on the market (which while not perfect, takes out emotion from the judging system).</p>
<p>We put in 1 million dollars, and wanted to be sure to reward two sets of developers... those that created paid apps, and those that generously offered up their code for free. It is kinda fun to be able to say "oh, thanks for giving this away for free, but here is a reward for your hard work."</p>
<p>We also didn't want to just give money to the top couple of developers, but wanted to spread the love (whilst still having prize amounts that are meaningful). If you take a look at <a href="http://projectappetite.com/">Project Appetite</a> you can do some math on how you still have a great chance to make some $ if you get a great app into the competition.</p>
<p>So, if you fancy flexing some Web skills in mobile.... consider giving a run for Hot Apps.</p>
<p>Want to see some of the tools and a quick app build? Here is a <a href="http://almaer.com/blog/palm-run-a-walk-through-of-building-a-new-webos-application">screencast walkthrough</a> that shows building a simple webOS app taken from a look at a helper script that I wrote:</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10028692&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10028692&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/hot-apps-using-1m-to-reward-440-mobile-web-developers/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Microsoft </title>
		<link>http://ajaxian.com/archives/microsoft-loves-jquery</link>
		<comments>http://ajaxian.com/archives/microsoft-loves-jquery#comments</comments>
		<pubDate>Tue, 16 Mar 2010 17:03:22 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8734</guid>
		<description><![CDATA[Update: Here is a full set of release notes on the platform preview (called that as it is more of a shell than a browser.
Rey Bango (Ajaxian and now Microsoft employee) will do a post that rounds up the news from MIX today where the IE9 team shared a first preview release of IE9 that [...]]]></description>
			<content:encoded><![CDATA[<p>Update: <a href="http://ie.microsoft.com/testdrive/info/releasenotes/">Here is a full set of release notes</a> on the platform preview (called that as it is more of a shell than a browser.</p>
<p>Rey Bango (Ajaxian and now Microsoft employee) will do a post that rounds up the news from MIX today where the IE9 team shared <a href="http://ie.microsoft.com/testdrive/">a first preview release of IE9</a> that comes with new features from HTML5+ (video, SVG, CSS3, addEventListener, JavaScript compilation spread across multicore, and more). All of this is hardware accelerated. Yum. Missing was news on canvas and I didn't see deets on CSS transforms and the like (which would be awesome with hardware acceleration too).</p>
<p>John Resig just got on stage to talk about the collaboration between jQuery and Microsoft and how Microsoft is now contribution resources and code. For example, <a href="http://forum.jquery.com/topic/jquery-templates-proposal">templates</a> (all on <a href="http://wiki.github.com/nje/jquery/jquery-templates-proposal">GitHub</a> which gives you:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-6');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-6">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var product = { name: &quot;Laptop&quot;, price: 788.67 };</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $(showProduct);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; function showProduct() {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#results&quot;).html( tmpl(&quot;productTemplate&quot;, product) );</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; function formatPrice(price) {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; return &quot;$&quot; + price;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/html"</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"productTemplate"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Product Name: <span style="color: #009900;">&lt;%= <span style="color: #000066;">name</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">&lt;br</span></a> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Product Price: <span style="color: #009900;">&lt;%= formatPrice<span style="color:#006600; font-weight:bold;">&#40;</span>price<span style="color:#006600; font-weight:bold;">&#41;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></a></span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"results"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><b>updated</b> with info from <a href="http://www.microsoft.com/presspass/press/2010/mar10/03-16MIX10Day2PR.mspx">Microsoft press release</a>:</p>
<blockquote><p>
As part of Microsoft’s broad engagement with open source communities, Corporate Vice President Scott Guthrie today announced that Microsoft is investing resources to contribute to the development of the jQuery JavaScript Library to help improve the development process of standards-based Web applications. Microsoft will also work to provide better interoperability between ASP.NET and the jQuery JavaScript Library by enhancing ASP.NET so .NET developers can better incorporate jQuery capabilities. In addition, Microsoft will actively promote and distribute versions of the jQuery JavaScript Library by packaging it with popular products such as Microsoft Visual Studio 2010 and ASP.NET MVC 2. As a first step, Microsoft will contribute a templating engine to the jQuery JavaScript Library Team to simplify Web applications.
</p></blockquote>
<p>It is early days (preview release) but great to see a solid go at it here. I *really* want the IE9 team to help us put the Silverlight team out of business :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/microsoft-loves-jquery/feed</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Sputnik gets more tests; How compliant are the browsers?</title>
		<link>http://ajaxian.com/archives/sputnik-gets-more-tests-how-compliant-are-the-browsers</link>
		<comments>http://ajaxian.com/archives/sputnik-gets-more-tests-how-compliant-are-the-browsers#comments</comments>
		<pubDate>Tue, 16 Mar 2010 11:34:00 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8723</guid>
		<description><![CDATA[
The Chromium folk have posted about JavaScript conformance as they release a test runner for Sputnik, that allows you to easily run the complete test suite from within your browser:

Sputnik touches all aspects of the JavaScript language defined in the 3rd edition of the ECMA-262 spec. In many ways it can be seen as a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://2.bp.blogspot.com/_LJuAPqyUVas/S5kFX5CnVYI/AAAAAAAAACs/vnO3XvDQ7HQ/s400/sputnik.png"/></p>
<p>The Chromium folk have <a href="http://blog.chromium.org/2010/03/does-your-browser-behave.html">posted about JavaScript conformance</a> as they <a href="http://sputnik.googlelabs.com/">release a test runner</a> for Sputnik, that allows you to easily run the complete test suite from within your browser:</p>
<blockquote><p>
Sputnik touches all aspects of the JavaScript language defined in the 3rd edition of the <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262</a> spec. In many ways it can be seen as a continuation of and a complement to existing browser conformance testing tools, such as the <a href="http://acid3.acidtests.org/">Acid3</a> test. While we are always focused on improving speed, Sputnik is not about testing how fast your browser executes JavaScript, but rather whether it does so correctly.</p>
<p>Since we released the Sputnik tests as an open source project, the most requested feature has been the ability to run the tests in a browser, and we are excited to launch that functionality today. The new test runner lets you run the tests from a single URL and quickly see the results in your browser. This makes it easier both for users to see how well their browser conforms to the JavaScript spec, as well as for browser makers to find bugs and incompatibilities.</p>
<p>You can also use Sputnik to <a href="http://sputnik.googlelabs.com/compare">compare browser conformance</a>.
</p></blockquote>
<p>The dart board shows relative conformance based on the number of tests that hit or miss. Of course, in the real world, all tests are not equal. This has been an issue with Acid tests. The race to 100 is socially interesting, but if you miss a few core tests that could be worse than meeting 10 corner cases in SVG :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/sputnik-gets-more-tests-how-compliant-are-the-browsers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Better Mobile Web; What else?</title>
		<link>http://ajaxian.com/archives/a-better-mobile-web-what-else</link>
		<comments>http://ajaxian.com/archives/a-better-mobile-web-what-else#comments</comments>
		<pubDate>Mon, 15 Mar 2010 15:41:13 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8725</guid>
		<description><![CDATA[Cedric Dugas feels so passionate about fixed positioning in WebKit that he created A Better Mobile Web to talk about it:

The Problem
It is impossible to have an element fixed in CSS on the page in the mobile Webkit browser. When you are surfing the web on your phone, webkit opens the page completely and acts [...]]]></description>
			<content:encoded><![CDATA[<p>Cedric Dugas feels so passionate about fixed positioning in WebKit that he created <a href="http://www.abettermobileweb.com/">A Better Mobile Web</a> to talk about it:</p>
<blockquote><p>
<b>The Problem</b></p>
<p>It is impossible to have an element fixed in CSS on the page in the mobile Webkit browser. When you are surfing the web on your phone, webkit opens the page completely and acts as a viewport.</p>
<p>"Imagine a book in front of you. Take a piece of paper, cut a 320*416 square in it, and lay it over the book. To read the book, move the paper around and position the hole over the words you want to see." -Richard Herrera</p>
<p><b>Why it is important</b></p>
<p>To create better mobile applications and websites, we need fixed positionning to give the user better tools to browse the web on handled devices. Like a real mobile app, we could have a fixed toolbar when scrolling on a site, it is critical to not take the user in hostage in very long list or on long content pages. This is something we can't really emulate in javascript as mobile devices are not really powerful.</p>
<p><b>The solution</b></p>
<p>The Webkit team could give us a proprietary CSS property that would overwrite the viewport behavior, and this is the proposition here. Give us a CSS property like position: -webkit-viewport-fixed that we can apply on a div so it can be fixed to the viewport.
</p></blockquote>
<p>That is one feature request, but surely there we can add to that? The broad domain of "abettermobileweb.com" deserves more!</p>
<p>What would you like to see for mobile specifically that isn't covered in the current Web and device API standard work?</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/a-better-mobile-web-what-else/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>A deep dive and analysis of the JavaScript Module pattern</title>
		<link>http://ajaxian.com/archives/a-deep-dive-and-analysis-of-the-javascript-module-pattern</link>
		<comments>http://ajaxian.com/archives/a-deep-dive-and-analysis-of-the-javascript-module-pattern#comments</comments>
		<pubDate>Mon, 15 Mar 2010 11:38:35 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8721</guid>
		<description><![CDATA[Ben Cherry has a really nice detailed analysis of the module pattern.
He starts with the simple pattern that Crock-y documented back in the day..... and then goes on to discuss augmentation (loose and strict) and then deeper into some cool patterns:

Cloning and Inheritance
PLAIN TEXT
JAVASCRIPT:




&#160;


var MODULE_TWO = &#40;function &#40;old&#41; &#123; 


&#160; &#160; var my = &#123;&#125;, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/">Ben Cherry</a> has a really nice <a href="http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth">detailed analysis of the module pattern</a>.</p>
<p>He starts with the simple pattern that Crock-y documented back in the day..... and then goes on to discuss augmentation (loose and strict) and then deeper into some cool patterns:</p>
<blockquote><p>
<b>Cloning and Inheritance</b></p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-10');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-10">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> MODULE_TWO = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>old<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> my = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; key; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span>key <span style="color: #000066; font-weight: bold;">in</span> old<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>old.<span style="color: #006600;">hasOwnProperty</span><span style="color:#006600; font-weight:bold;">&#40;</span>key<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span> = old<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> super_moduleMethod = old.<span style="color: #006600;">moduleMethod</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; my.<span style="color: #006600;">moduleMethod</span> = <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// override method on the clone, access to super through super_moduleMethod </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> my; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#40;</span>MODULE<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>This pattern is perhaps the least flexible option. It does allow some neat compositions, but that comes at the expense of flexibility. As I've written it, properties which are objects or functions will not be duplicated, they will exist as one object with two references. Changing one will change the other. This could be fixed for objects with a recursive cloning process, but probably cannot be fixed for functions, except perhaps with eval. Nevertheless, I've included it for completeness.</p>
<p><b>Cross-File Private State</b></p>
<p>One severe limitation of splitting a module across multiple files is that each file maintains its own private state, and does not get access to the private state of the other files. This can be fixed. Here is an example of a loosely augmented module that will maintain private state across all augmentations:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-11');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-11">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> MODULE = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>my<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> _private = my._private = my._private || <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; _seal = my._seal = my._seal || <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">delete</span> my._private; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">delete</span> my._seal; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">delete</span> my._unseal; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; _unseal = my._unseal = my._unseal || <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my._private = _private; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my._seal = _seal; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my._unseal = _unseal; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// permanent access to _private, _seal, and _unseal </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> my; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#40;</span>MODULE || <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Any file can set properties on their local variable _private, and it will be immediately available to the others. Once this module has loaded completely, the application should call MODULE._seal(), which will prevent external access to the internal _private. If this module were to be augmented again, further in the application's lifetime, one of the internal methods, in any file, can call _unseal() before loading the new file, and call _seal() again after it has been executed.</p>
<p>This pattern occurred to me today while I was at work, I have not seen this elsewhere. I think this is a very useful pattern, and would have been worth writing about all on its own.</p>
<p><b>Sub-modules</b></p>
<p>Our final advanced pattern is actually the simplest. There are many good cases for creating sub-modules. It is just like creating regular modules:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-12');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-12">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">MODULE.<span style="color: #006600;">sub</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> my = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ... </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> my; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>While this may have been obvious, I thought it worth including. Sub-modules have all the advanced capabilities of normal modules, including augmentation and private state.
</p></blockquote>
<p>Nice work Ben!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/a-deep-dive-and-analysis-of-the-javascript-module-pattern/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Ambilight Sample; video and canvas</title>
		<link>http://ajaxian.com/archives/ambilight</link>
		<comments>http://ajaxian.com/archives/ambilight#comments</comments>
		<pubDate>Fri, 12 Mar 2010 11:30:20 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8713</guid>
		<description><![CDATA[
Sergey Chikuyonok gets his Philips Ambilight foo on as he created a HTML5 video + canvas sample that mimics the TV effect.
As the video runs, a snapshot is sent over to JavaScript land where colors are worked out:
PLAIN TEXT
JAVASCRIPT:




&#160;


function getMidColors&#40;side&#41; &#123;


&#160; &#160; &#160; &#160; var w = buffer.width,


&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ajaxian.com/wp-content/images/ambilight.png" alt="ambilight" title="ambilight" width="480" height="234" class="alignnone size-full wp-image-8714"/></p>
<p>Sergey Chikuyonok gets his Philips Ambilight foo on as he created a <a href="http://chikuyonok.ru/ambilight/">HTML5 video + canvas</a> sample that mimics the TV effect.</p>
<p>As the video runs, a snapshot is sent over to JavaScript land where colors are worked out:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-14');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-14">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> getMidColors<span style="color:#006600; font-weight:bold;">&#40;</span>side<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> w = buffer.<span style="color: #006600;">width</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; h = buffer.<span style="color: #006600;">height</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lamps = getOption<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'lamps'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; block_width = getOption<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'block_size'</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; block_height = Math.<span style="color: #006600;">ceil</span><span style="color:#006600; font-weight:bold;">&#40;</span>h / lamps<span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pxl = block_width * block_height * <span style="color:#800000;">4</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; img_data = buffer_ctx.<span style="color: #006600;">getImageData</span><span style="color:#006600; font-weight:bold;">&#40;</span>side == <span style="color: #3366CC;">'right'</span> ? w - block_width : <span style="color:#800000;">0</span>, <span style="color:#800000;">0</span>, block_width, h<span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; total_pixels = img_data.<span style="color: #006600;">data</span>.<span style="color: #006600;">length</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i = <span style="color:#800000;">0</span>; i &lt;lamps; i++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> from = i * w * block_width;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result.<span style="color: #006600;">push</span><span style="color:#006600; font-weight:bold;">&#40;</span> calcMidColor<span style="color:#006600; font-weight:bold;">&#40;</span>img_data.<span style="color: #006600;">data</span>, i * pxl, Math.<span style="color: #006600;">min</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>i + <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> * pxl, total_pixels - <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> result;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Then, two canvas objects are placed, one on each side, of the video itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/ambilight/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>YQL Geo library &#8211; all your geo needs in pure JavaScript</title>
		<link>http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript</link>
		<comments>http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:04:15 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Geo]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[w3c geo]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8718</guid>
		<description><![CDATA[I just finished doing some talks on geo hacking (slides are available here) and how to use some of the Geo technologies Yahoo and Google provide as part of a University gig in Atlanta. 
As a lot of the students liked the idea of APIs like GeoPlanet and Placemaker but had a hard time getting [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished doing some talks on geo hacking (<a href="http://www.slideshare.net/cheilmann/introduction-to-geo-hacking-with-amongst-others-yahoo-technology-3388374">slides are available here</a>) and how to use some of the Geo technologies Yahoo and Google provide as part of a University gig in Atlanta. </p>
<p>As a lot of the students liked the idea of APIs like <a href="http://developer.yahoo.com/geo">GeoPlanet and Placemaker</a> but had a hard time getting their head around them I thought it a good idea to build a small JavaScript library that does the job for them. </p>
<p>I give you <a href="http://isithackday.com/hacks/geo/yql-geo-library/">the YQL Geo library</a> (<a href="http://github.com/codepo8/YQL-Geo-Library">and its source on GitHub</a>). Using this library you can do the following:</p>
<ul>
<li>Detecting the visitor's location with the W3C geo API and with IP as a fallback</li>
<li>Find geo location from text</li>
<li>Find location from lat/lon pair</li>
<li>Find locations in a certain web document (by URL)</li>
<li>Get the location for a certain IP number</li>
</ul>
<p>And all of that in pure JavaScript. For example:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-19');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-19">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">yqlgeo.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">'paris,fr'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;console.<span style="color: #006600;">log</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Will get you: </p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-20');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-20">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">"place"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"lang"</span>:<span style="color: #3366CC;">"en-US"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"uri"</span>:<span style="color: #3366CC;">"http://where.yahooapis.com/v1/place/615702"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"woeid"</span>:<span style="color: #3366CC;">"615702"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"placeTypeName"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">"7"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Town"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"name"</span>:<span style="color: #3366CC;">"Paris"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"country"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">"FR"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Country"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"France"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"admin1"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">""</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Region"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Ile-de-France"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"admin2"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"code"</span>:<span style="color: #3366CC;">"FR-75"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Department"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Paris"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"admin3"</span>:<span style="color: #003366; font-weight: bold;">null</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"locality1"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"type"</span>:<span style="color: #3366CC;">"Town"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"content"</span>:<span style="color: #3366CC;">"Paris"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"locality2"</span>:<span style="color: #003366; font-weight: bold;">null</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"postal"</span>:<span style="color: #003366; font-weight: bold;">null</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"centroid"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"latitude"</span>:<span style="color: #3366CC;">"48.856918"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"longitude"</span>:<span style="color: #3366CC;">"2.341210"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #3366CC;">"boundingBox"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"southWest"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"latitude"</span>:<span style="color: #3366CC;">"48.658291"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"longitude"</span>:<span style="color: #3366CC;">"2.086790"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #3366CC;">"northEast"</span>:<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"latitude"</span>:<span style="color: #3366CC;">"49.046940"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">"longitude"</span>:<span style="color: #3366CC;">"2.637910"</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>Other uses:</p>
<p>This gets the name and the country of a lat/lon pair:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-21');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-21">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">yqlgeo.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">33</span>.<span style="color:#800000;">748</span>,-<span style="color:#800000;">84</span>.<span style="color:#800000;">393</span>,<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">alert</span><span style="color:#006600; font-weight:bold;">&#40;</span>o.<span style="color: #006600;">place</span>.<span style="color: #006600;">name</span> + <span style="color: #3366CC;">','</span> + o.<span style="color: #006600;">place</span>.<span style="color: #006600;">country</span>.<span style="color: #006600;">content</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>This finds the visitor's location (on W3C geo API enabled browsers it asks them to share it - otherwise it detects the IP and locates this one on the planet)</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-22');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-22">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">yqlgeo.<span style="color: #006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'visitor'</span>,<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">alert</span><span style="color:#006600; font-weight:bold;">&#40;</span>o.<span style="color: #006600;">place</span>.<span style="color: #006600;">name</span> + <span style="color: #3366CC;">','</span> + o.<span style="color: #006600;">place</span>.<span style="color: #006600;">country</span>.<span style="color: #006600;">content</span> +&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">' ('</span> + o.<span style="color: #006600;">place</span>.<span style="color: #006600;">centroid</span>.<span style="color: #006600;">latitude</span> + <span style="color: #3366CC;">','</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;o.<span style="color: #006600;">place</span>.<span style="color: #006600;">centroid</span>.<span style="color: #006600;">longitude</span> + <span style="color: #3366CC;">')'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>Read all about it <a href="http://www.wait-till-i.com/2010/03/11/yql-geo-library-and-introduction-to-geo-hacking-talk/">on my blog</a> and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/yql-geo-library-all-your-geo-needs-in-pure-javascript/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SVG Wow!</title>
		<link>http://ajaxian.com/archives/svg-wow</link>
		<comments>http://ajaxian.com/archives/svg-wow#comments</comments>
		<pubDate>Thu, 11 Mar 2010 10:35:01 +0000</pubDate>
		<dc:creator>Brad Neuberg</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8614</guid>
		<description><![CDATA[Erik Dahlström and Vincent Hardy have put together a cool website, called SVG Wow!, that showcases SVG doing things you didn't expect SVG can do:


There are alot of unique demos on there.
One of my favorites uses SVG, HTML5 Audio, Web Fonts, and YUI to play music accompanied by flying animated lyrics (Chrome and Safari only):

There [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://my.opera.com/MacDev_ed/blog/">Erik </a><span><a href="http://my.opera.com/MacDev_ed/blog/">Dahlström</a> and <a href="http://www.w3.org/People/VHardy/">Vincent Hardy</a> have put together a cool website, called <a href="http://svg-wow.org/">SVG Wow!</a>, that showcases SVG doing things you didn't expect SVG can do:</span></p>
<p style="text-align: center;"><span><a href="http://svg-wow.org/"><img class="aligncenter size-full wp-image-8694" title="svgwow1" src="http://ajaxian.com/wp-content/images/svgwow11.png" alt="svgwow1" width="386" height="307" /></a><br />
</span></p>
<p>There are alot of unique demos on there.</p>
<p><a href="http://svg-wow.org/audio/animated-lyrics.html">One of my favorites</a> uses SVG, HTML5 Audio, Web Fonts, and YUI to play music accompanied by flying animated lyrics (Chrome and Safari only):</p>
<p><a href="http://svg-wow.org/audio/animated-lyrics.html"><img class="aligncenter size-full wp-image-8695" title="svgwow2" src="http://ajaxian.com/wp-content/images/svgwow2.png" alt="svgwow2" width="531" height="364" /></a></p>
<p><a href="http://svg-wow.org/">There are lots of other great samples</a> for you to play with and study!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/svg-wow/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ext JS 3.2 beta: stores, components, transitions, and themes</title>
		<link>http://ajaxian.com/archives/ext-js-3-2-beta-stores-components-transitions-and-themes</link>
		<comments>http://ajaxian.com/archives/ext-js-3-2-beta-stores-components-transitions-and-themes#comments</comments>
		<pubDate>Thu, 11 Mar 2010 06:12:05 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Ext]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8716</guid>
		<description><![CDATA[The Ext JS team have announced the 3.2 beta which includes new components and goodness.
Take the animated DataView transitions for example:

On top of that, the release includes:

Multiple sorting and filtering on Ext.data.Store

Composite Fields

Slider improvements

Toolbar plugins:  ToolbarReorderer and ToolbarDroppable

New Accessibility Theme: compliant with Section 508 of the Disabilities Act.

Quality Assurance: Unit Testing: over 180 bug [...]]]></description>
			<content:encoded><![CDATA[<p>The Ext JS team have <a href="http://www.extjs.com/blog/2010/03/09/announcing-ext-js-3-2-beta-multisort-transitions-and-composite-fields/">announced the 3.2 beta</a> which includes new components and goodness.</p>
<p>Take the animated DataView transitions for example:</p>
<p><object width="480" height="374"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10040484&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10040484&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="374"></embed></object></p>
<p>On top of that, the release includes:</p>
<ul>
<li><a href="http://www.extjs.com/deploy/ext-3.2-beta/examples/grid/multiple-sorting.html">Multiple sorting and filtering on Ext.data.Store</a>
</li>
<li><a href="http://www.extjs.com/deploy/ext-3.2-beta/examples/form/composite-field.html">Composite Fields</a>
</li>
<li><a href="http://www.extjs.com/deploy/ext-3.2-beta/examples/slider/slider.html">Slider improvements</a>
</li>
<li>Toolbar plugins: <a href="http://www.extjs.com/deploy/ext-3.2-beta/examples/toolbar/reorderable.html"> ToolbarReorderer</a> and <a href="http://www.extjs.com/deploy/ext-3.2-beta/examples/toolbar/droppable.html">ToolbarDroppable</a>
</li>
<li>New Accessibility Theme: compliant with Section 508 of the Disabilities Act.
</li>
<li>Quality Assurance: Unit Testing: over 180 bug fixes and enhancements over 3.1
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/ext-js-3-2-beta-stores-components-transitions-and-themes/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>CSS3 Please! Instant results&#8230; Thank You</title>
		<link>http://ajaxian.com/archives/css3-please-instant-results-thank-you</link>
		<comments>http://ajaxian.com/archives/css3-please-instant-results-thank-you#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:39:24 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8699</guid>
		<description><![CDATA[
Paul Irish and Jonathan Neal have created a fun example of various CSS tweaks that you can make, and see the results instantly.
CSS3, Please! lets you play with fancy new rules such as:

border-radius
box shadow
gradients
rgba support in backgrounds
transforms
font-face

Really nice way to make tweaks inline in the page..... nicely done. Hope to see some other examples out [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ajaxian.com/wp-content/images/css3please.png" alt="css3please" title="css3please" width="480" height="286" class="alignnone size-full wp-image-8700"/></p>
<p><a href="http://paulirish.com/">Paul Irish</a> and <a href="http://twitter.com/jon_neal">Jonathan Neal</a> have created a fun example of various CSS tweaks that you can make, and see the results instantly.</p>
<p><a href="http://css3please.com/">CSS3, Please!</a> lets you play with fancy new rules such as:</p>
<ul>
<li>border-radius</li>
<li>box shadow</li>
<li>gradients</li>
<li>rgba support in backgrounds</li>
<li>transforms</li>
<li>font-face</li>
</ul>
<p>Really nice way to make tweaks inline in the page..... nicely done. Hope to see some other examples out there :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/css3-please-instant-results-thank-you/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HTML Minification</title>
		<link>http://ajaxian.com/archives/html-minification</link>
		<comments>http://ajaxian.com/archives/html-minification#comments</comments>
		<pubDate>Wed, 10 Mar 2010 11:14:51 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8697</guid>
		<description><![CDATA[Good old Kangax has been playing with HTML minification and has shared his new tool in an early stage.

What does it do?
Kangax has forked John Resig's HTML parser which parses the HTML and sends that into the Minifier. This has rules that do things like whitespace optimization, comment removal, and collapsing boolean attributes (e.g. disabled="true" [...]]]></description>
			<content:encoded><![CDATA[<p>Good old Kangax has been <a href="http://perfectionkills.com/experimenting-with-html-minifier/">playing with HTML minification</a> and has shared <a href="http://kangax.github.com/html-minifier/">his new tool</a> in an early stage.</p>
<p><img src="http://perfectionkills.com/images/minifier-screenshot.png" width="480"/></p>
<p><b>What does it do?</b></p>
<p>Kangax has <a href="http://github.com/kangax/html-minifier/blob/gh-pages/src/htmlparser.js">forked John Resig's HTML parser</a> which parses the HTML and sends that into the Minifier. This has rules that do things like whitespace optimization, comment removal, and collapsing boolean attributes (e.g. disabled="true" -> disabled).</p>
<p>He also has a linter going:</p>
<blockquote><p>
While working on minifier, I realized that oftentimes the most wasteful part of the markup is not white space, comments or boolean attributes, but inline styles, scripts, presentational or deprecated elements and attributes. None of these can be simply stripped, as that could affect state of the document and is just too obtrusive. What can be done, however, is reporting of these occurences to the user. HTMLLint is even a smaller script, whose job is exactly that—to log any deprecated or presentational elements/attributes encountered during parsing. Additionally, it detects event attributes (e.g. onclick, onmouseover, etc.). The rationale for this is that moving contents of event attributes to external script allows to <a href="http://perfectionkills.com/optimizing-html/#3_onclick_onmouseover_etc">take advantage of resource caching</a>.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/html-minification/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Harmony: Canvas Drawing Tool</title>
		<link>http://ajaxian.com/archives/harmony-canvas-drawing-tool</link>
		<comments>http://ajaxian.com/archives/harmony-canvas-drawing-tool#comments</comments>
		<pubDate>Wed, 10 Mar 2010 09:50:44 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8702</guid>
		<description><![CDATA[
Harmony is a new drawing tool, a HTML5/Canvas experiment with great potential. It provides some unique brush styles, and can produce some great-looking charcoal pencil style sketches, among other things. Better to try it out than explain it in words.
Creator Mr. Doob  (Richard Cabello) explains how he used Canvas to make it darker the [...]]]></description>
			<content:encoded><![CDATA[<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/To1A-EPz79w&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/To1A-EPz79w&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p><a href="http://mrdoob.com/lab/javascript/harmony/">Harmony</a> is a new drawing tool, a HTML5/Canvas experiment with great potential. It provides some unique brush styles, and can produce some great-looking charcoal pencil style sketches, among other things. Better to <a href="http://mrdoob.com/lab/javascript/harmony/">try it out</a> than explain it in words.</p>
<p>Creator Mr. Doob  (Richard Cabello) <a href="http://mrdoob.com/blog/post/689">explains</a> how he used Canvas to make it darker the more you draw over it:</p>
<blockquote><p>
The whole thing is quite modular so I can keep adding more brush styles whenever I get inspired. During the process I found out that, for some reason (apparently lack of hardware acceleration), Firefox and Opera do not support context.globalCompositeOperation = 'darker'. This was on the HTML5 spec before but got removed. Just so you know what I'm talking about, this is like the "multiply" blending in Photoshop. Webkit does support it tho. I hope they put it back on the specs and all browsers support it.
</p></blockquote>
<p>You can also save images using data URI encoding.</p>
<p>As it works on webkit, he made sure it worked on the mobile Android and iPhone browsers. No multi-touch as yet, but the touch UI still makes a nice input mechanism.</p>
<p><a href="http://mrdoob.com/lab/javascript/harmony/"><img src="http://ajaxian.com/wp-content/images/harmony.jpg" alt="harmony" title="harmony" width="320" height="480" class="alignnone size-full wp-image-8703" /></a></p>
<p>(Thanks <a href="http://twitter.com/FND">FND</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/harmony-canvas-drawing-tool/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Spectrum Visualization with the HTML5 Audio Data API</title>
		<link>http://ajaxian.com/archives/spectrum-visualization-with-the-html5-audio-data-api</link>
		<comments>http://ajaxian.com/archives/spectrum-visualization-with-the-html5-audio-data-api#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:20:07 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Sound]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8690</guid>
		<description><![CDATA[
The HTML5 specification introduces the  and  media elements, and with them the opportunity to dramatically change the way we integrate media on the web. The current HTML5 media API provides ways to play and get limited information about audio and video, but gives no way to programatically access or create such media. We [...]]]></description>
			<content:encoded><![CDATA[<blockquote cite="https://wiki.mozilla.org/Audio_Data_API"><p>
The HTML5 specification introduces the <audio> and <video> media elements, and with them the opportunity to dramatically change the way we integrate media on the web. The current HTML5 media API provides ways to play and get limited information about audio and video, but gives no way to programatically access or create such media. We present a new extension to this API, which allows web developers to read and write raw audio data.<br />
</video></audio></p></blockquote>
<p>The above quote is from the <a href="https://wiki.mozilla.org/Audio_Data_API">Audio Data API</a> extension that joins a bunch of juicy developer work in Firefox 3.7.</p>
<p>Thomas Sturm has taken that API and <a href="http://www.storiesinflight.com/jsfft/visualizer/index.html">created a spectrum visualization</a> a kin to some of the great work by Scott Schiller (using Flash).</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/LrZ4S4BNv08&#038;color1=0x3a3a3a&#038;color2=0x999999&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/LrZ4S4BNv08&#038;color1=0x3a3a3a&#038;color2=0x999999&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>
<p>There is a new <code>onaudiowritten</code> attribute:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-26');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-26">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;">&lt;audio <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"song.ogg"</span> controls=<span style="color: #ff0000;">"true"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;onaudiowritten=<span style="color: #ff0000;">"audioWritten(event);"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>/audio&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>that lets you get access to info such as the spectrum:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-27');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-27">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> audioWritten<span style="color:#006600; font-weight:bold;">&#40;</span>event<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; spectrum = event.<span style="color: #006600;">mozSpectrum</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> specSize = spectrum.<span style="color: #006600;">length</span>, magnitude;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Clear the canvas before drawing spectrum</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ctx.<span style="color: #006600;">clearRect</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">0</span>,<span style="color:#800000;">0</span>, canvas.<span style="color: #006600;">width</span>, canvas.<span style="color: #006600;">height</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i = <span style="color:#800000;">0</span>; i &lt;specSize; i++ <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; magnitude = spectrum.<span style="color: #006600;">item</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#800000;">4000</span>; <span style="color: #009900; font-style: italic;">// multiply spectrum by a zoom value</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Draw rectangle bars for each frequency bin</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ctx.<span style="color: #006600;">fillRect</span><span style="color:#006600; font-weight:bold;">&#40;</span>i * <span style="color:#800000;">4</span>, canvas.<span style="color: #006600;">height</span>, <span style="color:#800000;">3</span>, -magnitude<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Add to that the ability to write audio.... </p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-28');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-28">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> audioOutput = <span style="color: #003366; font-weight: bold;">new</span> Audio<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">audioOutput.<span style="color: #006600;">mozSetup</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">2</span>, <span style="color:#800000;">44100</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> samples = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">0</span>.<span style="color:#800000;">242</span>, <span style="color:#800000;">0</span>.<span style="color:#800000;">127</span>, <span style="color:#800000;">0</span>.<span style="color:#800000;">0</span>, -<span style="color:#800000;">0</span>.<span style="color:#800000;">058</span>, -<span style="color:#800000;">0</span>.<span style="color:#800000;">242</span>, ...<span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">audioOutput.<span style="color: #006600;">mozAudioWrite</span><span style="color:#006600; font-weight:bold;">&#40;</span>samples.<span style="color: #006600;">length</span>, samples<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Nice work all around.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/spectrum-visualization-with-the-html5-audio-data-api/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>modulr: a CommonJS module implementation in Ruby for client-side JavaScript</title>
		<link>http://ajaxian.com/archives/modulr-a-commonjs-module-implementation-in-ruby-for-client-side-javascript</link>
		<comments>http://ajaxian.com/archives/modulr-a-commonjs-module-implementation-in-ruby-for-client-side-javascript#comments</comments>
		<pubDate>Mon, 08 Mar 2010 11:28:40 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8688</guid>
		<description><![CDATA[
modulr is a CommonJS module implementation in Ruby for client-side JavaScript

Ruby? what does that have anything to do with it? Ah, its from one of those Prototype guys isn't it.... Yup, Tobie is at it again, this time with modulr:

modulr accepts a singular file as input (the program) on which is does static analysis to [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
modulr is a CommonJS module implementation in Ruby for client-side JavaScript
</p></blockquote>
<p>Ruby? what does that have anything to do with it? Ah, its from one of those Prototype guys isn't it.... Yup, Tobie is at it again, this time with <a href="http://github.com/codespeaks/modulr">modulr</a>:</p>
<blockquote><p>
modulr accepts a singular file as input (the program) on which is does static analysis to recursively resolve its dependencies.</p>
<p>The program, its dependencies and a small, namespaced JavaScript library are concatenated into a single js file.</p>
<p>The bundled JavaScript library provides each module with the necessary require function and exports and module free variables.
</p></blockquote>
<p>This can also help sharing that CommonJS code. I recently <a href="http://almaer.com/blog/building-an-web-application-from-the-inside-out-using-node-js-to-bootstrap-a-server-from-client-js">did just that</a> and had some:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-30');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-30">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// check to see if you are running inside of node.js and export if you are</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> GLOBAL == <span style="color: #3366CC;">"object"</span> &amp;&amp; <span style="color: #000066; font-weight: bold;">typeof</span> GLOBAL<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'node'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color: #3366CC;">"object"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; exports.<span style="color: #006600;">Appetite</span> = Appetite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/modulr-a-commonjs-module-implementation-in-ruby-for-client-side-javascript/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Friday fun: Let&#8217;s translate YUI3 to jQuery</title>
		<link>http://ajaxian.com/archives/friday-fun-lets-translate-yui3-to-jquery</link>
		<comments>http://ajaxian.com/archives/friday-fun-lets-translate-yui3-to-jquery#comments</comments>
		<pubDate>Fri, 05 Mar 2010 13:52:01 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[showmethe$]]></category>
		<category><![CDATA[yui3]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8685</guid>
		<description><![CDATA[I just came across this wonderful Gist on gitHub:
PLAIN TEXT
JAVASCRIPT:




&#160;


var $;


YUI&#40;&#41;.use&#40;'*', function&#40;Y&#41;&#123;


&#160; $ = Y.get;


&#160; for&#40;var p in Y&#41; &#123;


&#160; &#160; &#160; $&#91;p&#93; = Y&#91;p&#93;;


&#160; &#125;


&#125;&#41;;


&#160;


// test


$&#40;'body'&#41;.append&#40;"boo!"&#41;;


&#160;





In case you want to use YUI3 but really really like jQuery syntax :) OK, it breaks the whole sandboxing idea of YUI3, but that's a small price to [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across this wonderful Gist on gitHub:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-32');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-32">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> $;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">YUI<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">use</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'*'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>Y<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $ = Y.<span style="color: #006600;">get</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> p <span style="color: #000066; font-weight: bold;">in</span> Y<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; $<span style="color:#006600; font-weight:bold;">&#91;</span>p<span style="color:#006600; font-weight:bold;">&#93;</span> = Y<span style="color:#006600; font-weight:bold;">&#91;</span>p<span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// test</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">append</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"boo!"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>In case you want to use YUI3 but really really like jQuery syntax :) OK, it breaks the whole sandboxing idea of YUI3, but that's a small price to pay, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/friday-fun-lets-translate-yui3-to-jquery/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Firefox gets hardware acceleration in early stage</title>
		<link>http://ajaxian.com/archives/firefox-gets-hardware-acceleration-in-early-stage</link>
		<comments>http://ajaxian.com/archives/firefox-gets-hardware-acceleration-in-early-stage#comments</comments>
		<pubDate>Fri, 05 Mar 2010 11:25:43 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8683</guid>
		<description><![CDATA[Bass Schouten is a cool name, and the Mozillan has presented Direct2D hardware acceleration.
You have to grab Firefox nightly, do the about:config / gfx.font_rendering.directwrite.enabled game, but then you get to see it in action.
IE9 showed off how they will support hardware rendering, and I am sure we will see more at MIX, but it is [...]]]></description>
			<content:encoded><![CDATA[<p>Bass Schouten is a cool name, and the Mozillan has <a href="http://www.basschouten.com/blog1.php/2010/03/02/presenting-direct2d-hardware-acceleratio">presented Direct2D hardware acceleration</a>.</p>
<p>You have to grab Firefox nightly, do the <code>about:config</code> / <code>gfx.font_rendering.directwrite.enabled</code> game, but then you get to see it in action.</p>
<p>IE9 showed off <a href="http://ajaxian.com/archives/ie-9-hardware-rendering-new-js-engine-css-standards-and-more">how they will support hardware rendering</a>, and I am sure we will see more at MIX, but it is very cool to see this across the board.</p>
<p>CSS Transforms/Transitions/Animations are going to feel like butter in 2010!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/firefox-gets-hardware-acceleration-in-early-stage/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Color Picker: Works even in IE6</title>
		<link>http://ajaxian.com/archives/color-picker-works-even-in-ie6</link>
		<comments>http://ajaxian.com/archives/color-picker-works-even-in-ie6#comments</comments>
		<pubDate>Thu, 04 Mar 2010 11:02:56 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8680</guid>
		<description><![CDATA[
Works even in IE6

Love that quote from the color picker over at RaphaelJS land. This plugin by Dmitry Baranovskiy gives you an easy color picker in short order:
PLAIN TEXT
JAVASCRIPT:




&#160;


var icon = Raphael&#40;"picker", 23, 23&#41;.colorPickerIcon&#40;11, 11, 10&#41;;


&#160;


icon.attr&#40;&#123;cursor: "pointer"&#125;&#41;.node.onclick = function &#40;&#41; &#123;


&#160; &#160; document.getElementById&#40;"benefits"&#41;.style.visibility = "visible";


&#160; &#160; var out = document.getElementById&#40;"output"&#41;;


&#160; &#160; out.style.visibility = "visible";


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
Works even in IE6
</p></blockquote>
<p>Love that quote from the <a href="http://raphaeljs.com/picker/">color picker over at RaphaelJS land</a>. This plugin by Dmitry Baranovskiy gives you an easy color picker in short order:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-34');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-34">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> icon = Raphael<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"picker"</span>, <span style="color:#800000;">23</span>, <span style="color:#800000;">23</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">colorPickerIcon</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">11</span>, <span style="color:#800000;">11</span>, <span style="color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">icon.<span style="color: #006600;">attr</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>cursor: <span style="color: #3366CC;">"pointer"</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">node</span>.<span style="color: #006600;">onclick</span> = <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; document.<span style="color: #006600;">getElementById</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"benefits"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">visibility</span> = <span style="color: #3366CC;">"visible"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> out = document.<span style="color: #006600;">getElementById</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"output"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; out.<span style="color: #006600;">style</span>.<span style="color: #006600;">visibility</span> = <span style="color: #3366CC;">"visible"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// this is where colorpicker created</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> cp = Raphael.<span style="color: #006600;">colorpicker</span><span style="color:#006600; font-weight:bold;">&#40;</span>document.<span style="color: #006600;">body</span>.<span style="color: #006600;">offsetWidth</span> / <span style="color:#800000;">2</span> - <span style="color:#800000;">150</span>, <span style="color:#800000;">250</span>, <span style="color:#800000;">300</span>, <span style="color: #3366CC;">"#eee"</span>, document.<span style="color: #006600;">getElementById</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"picker2"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; out.<span style="color: #006600;">onkeyup</span> = <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; cp.<span style="color: #006600;">color</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">value</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// assigning onchange event handler</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cp.<span style="color: #006600;">onchange</span> = <span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>clr<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; out.<span style="color: #006600;">value</span> = clr;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; document.<span style="color: #006600;">body</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">background</span> = clr;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; document.<span style="color: #006600;">body</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">color</span> = Raphael.<span style="color: #006600;">rgb2hsb</span><span style="color:#006600; font-weight:bold;">&#40;</span>clr<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">b</span> &lt;.<span style="color:#800000;">5</span> ? <span style="color: #3366CC;">"#fff"</span> : <span style="color: #3366CC;">"#666"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// that’s it. Too easy</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;icon.<span style="color: #006600;">node</span>.<span style="color: #006600;">onclick</span> = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p><img src="http://ajaxian.com/wp-content/images/colorpicker.png" alt="colorpicker" title="colorpicker" width="480" height="429" class="alignnone size-full wp-image-8681"></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/color-picker-works-even-in-ie6/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Touching Cloth; Canvas Fu</title>
		<link>http://ajaxian.com/archives/touching-cloth-canvas-fu</link>
		<comments>http://ajaxian.com/archives/touching-cloth-canvas-fu#comments</comments>
		<pubDate>Wed, 03 Mar 2010 11:12:29 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8677</guid>
		<description><![CDATA[Andrew Hoyer shows his canvas Fu with Cloth, a great experiment using nice physics.


What makes this simulation special is the speed at which everything is computed. Javascript (the language this is written in) is not exactly the most efficient language for this type of computation. This being said, much time was spent squeezing out every [...]]]></description>
			<content:encoded><![CDATA[<p>Andrew Hoyer shows his canvas Fu with <a href="http://www.andrew-hoyer.com/experiments/cloth">Cloth</a>, a great experiment using nice physics.</p>
<p><img src="http://ajaxian.com/wp-content/images/cloth.png" alt="cloth" title="cloth" width="355" height="410" class="alignnone size-full wp-image-8678"/></p>
<blockquote><p>
What makes this simulation special is the speed at which everything is computed. Javascript (the language this is written in) is not exactly the most efficient language for this type of computation. This being said, much time was spent squeezing out every little detail that slows things down.</p>
<p>The most computationally expensive part is trying to satisfy the constraints. To do this requires the calculation of distance between two points. This is easy to do with a little math, but that often involves an expensive square root. This is something that cannot simply be thrown out either, so what do you do? You approximate it. There are lots of mathematical tools for approximating functions, in this case I chose the first couple terms of a taylor expansion.
</p></blockquote>
<p>Check out his <a href="http://www.andrew-hoyer.com/exp_src/cloth_JS/fast_vector.js">fast vector</a>, <a href="http://www.andrew-hoyer.com/exp_src/cloth_JS/constraint.js">constraints</a>, and finally the <a href="http://www.andrew-hoyer.com/exp_src/cloth_JS/cloth.js">cloth itself</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/touching-cloth-canvas-fu/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
