<?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>nolancaudill.com &#187; javascript</title>
	<atom:link href="http://nolancaudill.com/index.php/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://nolancaudill.com</link>
	<description>thoughts and whatnot</description>
	<lastBuildDate>Wed, 18 Nov 2009 03:47:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Keeping the music going</title>
		<link>http://nolancaudill.com/index.php/2009/02/22/keeping-the-music-going/</link>
		<comments>http://nolancaudill.com/index.php/2009/02/22/keeping-the-music-going/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 21:19:21 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[last.fm]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=107</guid>
		<description><![CDATA[I love listening to last.fm&#8217;s similar artist radio stations. I constantly forget that the music I am listening to is coming from one of my Firefox tabs, and will accidentally close it from time to time, stopping whatever music is playing. I decided to fix this for myself using a ridiculously short Greasemonkey script, using [...]]]></description>
			<content:encoded><![CDATA[<p>I love listening to last.fm&#8217;s similar artist radio stations. I constantly forget that the music I am listening to is coming from one of my Firefox tabs, and will accidentally close it from time to time, stopping whatever music is playing.</p>
<p>I decided to fix this for myself using a ridiculously short Greasemonkey script, using the window object&#8217;s &#8220;onbeforeunload&#8221; function to make sure I actually meant to close the tab/window.</p>
<p><a href="http://nolancaudill.com/wp-content/uploads/2009/02/lastfm.user.js">Here</a> it is for consumption. This is obviously not a work of genius or of any considerable effort, just a fix for my own absentmindedness.</p>
<p><strong>Updated:<br />
</strong>I added a little more functionality to the script. There is now a button that will show up in the top right corner that will let you turn off and on the close prompt so that you can browse the last.fm without getting the &#8216;Are you sure?&#8217; prompt on every page load.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2009/02/22/keeping-the-music-going/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helping jQuery Out</title>
		<link>http://nolancaudill.com/index.php/2008/10/14/helping-jquery-out/</link>
		<comments>http://nolancaudill.com/index.php/2008/10/14/helping-jquery-out/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 23:31:28 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/?p=26</guid>
		<description><![CDATA[I&#8217;ve made a commitment to myself to start helping out with some of my favorite open source projects. I&#8217;ve started helping in my own little way by hanging out in the jQuery IRC channel. It&#8217;s not much effort and I&#8217;ve already helped a few people, which feels good. I&#8217;m &#8216;mncaudill&#8217; in there, so feel free [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a commitment to myself to start helping out with some of my favorite open source projects. I&#8217;ve started helping in my own little way by hanging out in the jQuery IRC channel. It&#8217;s not much effort and I&#8217;ve already helped a few people, which feels good. I&#8217;m &#8216;mncaudill&#8217; in there, so feel free to say hi.</p>
<p>I&#8217;d eventually like to start contributing code, but I&#8217;d like to get used to the community first and see how things are done. With such an intentionally lead codebase, contributing actual code might be a challenge, so helping people out in the channel might be the best way to help.</p>
<p>Next up, I&#8217;d also like to help out with django by doing the same. With a more extensive codebase where size is not as big of as concern as it is in jQuery, getting a patch in or two would not be as difficult I would imagine.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2008/10/14/helping-jquery-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: a new joy</title>
		<link>http://nolancaudill.com/index.php/2007/11/07/jquery-a-new-joy/</link>
		<comments>http://nolancaudill.com/index.php/2007/11/07/jquery-a-new-joy/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 01:28:32 +0000</pubDate>
		<dc:creator>nolan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://nolancaudill.com/index.php/2007/11/07/jquery-a-new-joy/</guid>
		<description><![CDATA[At work, I have been working on somewhat complex site with a lot of Javascript going on in the form of some ajax calls and Google Maps. We noticed that the site had an almost painful load time, approximately 8 seconds for a fresh pull of the home page. This was too much. The first [...]]]></description>
			<content:encoded><![CDATA[<p>At work, I have been working on somewhat complex site with a lot of Javascript going on in the form of some ajax calls and Google Maps. We noticed that the site had an almost painful load time, approximately 8 seconds for a fresh pull of the home page.  This was too much.</p>
<p>The first thing I did was profile it using Firebug&#8217;s Net tab. Of all the tools in my web developer&#8217;s tool chest, <a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a> is far-and-away my favorite, my oft-used, and my most recommended app. Not only does it give you a super nice DOM browser and a great Javascript debugger, but it also has a nice download profiler under its Net tab. It gives you every single element that the browser requests for your page with its HTTP headers and, even more importantly, the time to complete each transaction.</p>
<p>The profiling introduced a few things instantly. First, there were a lot of images and some were rather hefty. Since I was building the site from somebody else&#8217;s design files, and that is definitely not my domain, there was not much I could do about that.</p>
<p>The second thing was the Google Maps calls. I put the Google request calls at the end so the rest of the page could load before them. Doing just this took about a second and a half off a fresh homepage load. It was a marked improvement, but still nothing spectacular.</p>
<p>The final thing brings me to the topic of this post. Our standard JS library at work is <a href="http://dojotoolkit.org">Dojo</a>. Dojo is great when you are trying to create a RIA interface with all the bells and whistles, such as tabs, number spinners, rich text editors, grids, and trees. Its widget library, dijit, is quite impressive. An early complaint of dojo was that it was a big download. If I remember correctly it was something like 100kb. The Dojo team fixed this 0.9 with a more modular dependency download structure. Say you needed to only use widget A. You&#8217;d make the Dojo call in your page for the widget and Dojo would then only download the bits of JS it needed to get that widget on the page. The problem with this is that if you are only using a small subset of the library, you had an exorbitant overhead, not in download weight, but in HTTP requests.</p>
<p>For example, I was only using Dojo to do some absolute positioning stuff for some help tip bubbles and a few simple Ajax calls. This was like going squirrel hunting with a Scud missile. Even with just using core Dojo (no widgets), I made about a dozen HTTP requests just to get the pieces of JS I needed. In total, it took a little over 2 seconds just to load the JS library, even though it only equated to about 60Kb of total file size.</p>
<p>These small tasks almost bordered on something that I could do myself, but since I can be a <a href="http://undefined.com/ia/2006/10/24/the-fourteen-types-of-programmers-type-4-lazy-ones/">lazy programmer</a>, I figured a small lightweight JS library that people much smarter than myself have written and tested would be the ticket. I noticed that <a href="http://jquery.com">jQuery</a> was being mentioned more and more in a good way around the web, so I figured this would be the perfect trial to test it out. I can definitely say &#8216;mission accomplished&#8217; with jQuery.</p>
<p>I used the non-gzipped packed version which had a weight of 47Kb. This took around 50ms to download and even better it all came in one HTTP request, with no just-in-time loading. The Ajax API between Dojo and jQuery was similar enough that it took very little modification to port it over and I even minimized some of my Javascript to use the awesome syntax of jQuery. By simply switching to jQuery, I shaved a little over 2 seconds from the page load time with no loss of functionality. Nice.</p>
<p>After all the profiling and modifying, I managed to cut the page load from a little over 8 seconds to a little over 4 seconds.</p>
<p>As a side benefit, it was actually <em>fun</em> to write Javascript. With jQuery&#8217;s well-document API and function list (something that Dojo definitely lacks last checking), I spent more time Getting Things Done than tinkering and experimenting. I was actually trying to do things to improve the visual effects of the site because jQuery made it simple to do so. It was almost completely painless.</p>
<p>This is not a slam on Dojo at all, because if you need some advanced UI features, I&#8217;d definitely go down the path towards Dojo. This was simply using the best tool for the job.</p>
<p>I am now looking for more excuses to use the tiny, tidy little jQuery library in other spots. jQuery brought joy to Javascript development, something I wouldn&#8217;t really have thought possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://nolancaudill.com/index.php/2007/11/07/jquery-a-new-joy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->