<?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>jonathanjulian.com &#187; javascript</title>
	<atom:link href="http://jonathanjulian.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanjulian.com</link>
	<description>Ruby, Rails, JavaScript, software development</description>
	<lastBuildDate>Sat, 27 Feb 2010 16:59:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Ext JS book in the works</title>
		<link>http://jonathanjulian.com/2010/01/new-ext-js-book-in-the-works/</link>
		<comments>http://jonathanjulian.com/2010/01/new-ext-js-book-in-the-works/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:08:08 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=158</guid>
		<description><![CDATA[I&#8217;ve heard a rumor from a trusted source that the next version of Learning Ext JS is being written, and it may be titled Learning Ext JS 3.0. It will be updated to reflect working with version 3.x of the library, and have at least three new chapters added. If it is published in 2010, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve heard a rumor from a trusted source that the next version of <a href="http://learningextjs.com/">Learning Ext JS</a> is being written, and it may be titled <strong>Learning Ext JS 3.0</strong>. It will be updated to reflect working with version 3.x of the <a href="http://extjs.com/">library</a>, and have at least <strong><em>three</em></strong> new chapters added. If it is published in 2010, this could be a great year for Ext JS books, with <a href="http://extjsinaction.com/">Ext JS in Action</a> scheduled to go to print in June.</p>
<p><strong>UPDATE February 10</strong>: Confirmed! I&#8217;ve been asked to be a Technical Reviewer, and I&#8217;ve already received 3 chapters to review! This is going to be a great refresh for what I think is the best entry-level Ext JS book.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2010/01/new-ext-js-book-in-the-works/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Five Tips to Improve Your Ext JS Application</title>
		<link>http://jonathanjulian.com/2010/01/five-tips-to-improve-your-ext-js-application/</link>
		<comments>http://jonathanjulian.com/2010/01/five-tips-to-improve-your-ext-js-application/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 00:43:47 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=138</guid>
		<description><![CDATA[Three Pillar Global sponsored their first Ext JS meetup earlier this week, and they were kind enough to invite me to give one of the presentations. Thanks to Patrick Sheridan (@sheridap) of Three Pillar for pulling it together, and providing the delicious pizza! My presentation was inserted between Shea Frederick and Jay Garcia&#8217;s. Pretty good [...]]]></description>
			<content:encoded><![CDATA[<h3 style="font-size: 1.17em;"><span style="font-weight: normal; font-size: 13px;"><a href="http://www.threepillarsoftware.com/">Three Pillar Global</a> sponsored their first <a href="http://www.meetup.com/baltimore-dc-javascript-users/calendar/12219819/">Ext JS meetup</a> earlier this week, and they were kind enough to invite me to give one of the presentations. Thanks to Patrick Sheridan (<a href="http://twitter.com/sheridap">@sheridap</a>) of Three Pillar for pulling it together, and providing the delicious pizza! My presentation was inserted between <a href="http://www.vinylfox.com/">Shea Frederick</a> and <a href="http://tdg-i.com/">Jay Garcia</a>&#8217;s. Pretty good company, I&#8217;d say.</span></h3>
<p>Pat started off discussing &#8220;<a href="http://www.slideshare.net/threepillar/three-pillar-global-design-for-use">Design for Use</a>&#8220;. Then Shea told us all about &#8220;<a href="http://www.slideshare.net/VinylFox/practical-ext-js-debugging">Practical Ext JS Debugging</a>&#8220;.</p>
<p>My talk is titled &#8220;Five Tips to Improve Your Ext JS Application&#8221;. I briefly touch on five distinct strategies to use to make your code more maintainable and reusable. Below the slides and video is a short discussion of each topic:</p>
<div id="__ss_2958396" style="width: 425px; text-align: left;"><a style="font: 14px Helvetica,Arial,Sans-serif; display: block; margin: 12px 0 3px 0; text-decoration: underline;" title="Five Tips To Improve Your Ext Js Application" href="http://www.slideshare.net/jonathanjulian/five-tips-to-improve-your-ext-js-application">Five Tips To Improve Your Ext Js Application</a><object style="margin: 0px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fivetipstoimproveyourextjsapplication-100120131238-phpapp01&amp;rel=0&amp;stripped_title=five-tips-to-improve-your-ext-js-application" /><param name="allowfullscreen" value="true" /><embed style="margin: 0px;" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fivetipstoimproveyourextjsapplication-100120131238-phpapp01&amp;rel=0&amp;stripped_title=five-tips-to-improve-your-ext-js-application" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration: underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration: underline;" href="http://www.slideshare.net/jonathanjulian">Jonathan Julian</a>.</div>
</div>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9768559&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=9768559&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="300"></embed></object>
<p><a href="http://vimeo.com/9768559">Jonathan Julian at the Northern Virginia Ext JS meetup at Three Pillar Global on 1/19/10</a> from <a href="http://vimeo.com/user3205431">Jay Garcia</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<h3>Define your own components</h3>
<p>Explicitly define your own &#8220;classes&#8221; as you build your UI. This will allow your code to be more reusable, testable, and maintainable. It&#8217;s really easy to do, and along with namespacing your files and only defining one component per file, this approach will lead to amazingly clear directory structure.</p>
<h3>Use an event manager</h3>
<p>Sometimes also known as an &#8220;event broker&#8221;, this is a simple object used to centralize all events. The example in the presentation is the &#8220;simplest event manager you can build with Ext JS&#8221;. I like to use at least one in every project to simplify the coding when someone inevitably asks, &#8220;can you make it do X every time the user does Y?&#8221;</p>
<div id="attachment_146" class="wp-caption alignleft" style="width: 290px"><img class="size-medium wp-image-146" title="describing an event manager" src="http://jonathanjulian.com/wp-content/uploads/2010/01/five_tips-crop-280x300.jpg" alt="Here I am describing the MyApp.eventManager" width="280" height="300" /><p class="wp-caption-text">Fire an event on the MyApp.eventManager</p></div>
<h3>Override the framework properly</h3>
<p>Anytime you need to &#8220;hack&#8221; the framework, do your work in a special file (or dir): call it &#8220;overrides&#8221;. Then when you test your upgrade to the next version of Ext JS, all the integration points to inspect are in one place. I also included my idea of a standard directory layout. I think it works well with the idea of &#8220;Namespace Segmentation&#8221; as discussed in Chapter 16 of <a href="http://extjsinaction.com/">Ext JS in Action</a>.</p>
<h3>Remember, it&#8217;s still a web app</h3>
<p>Write good JavaScript code. Use <a href="http://jslint.com/">JSLint</a>. Read <a href="http://jonathanjulian.com/2009/07/javascript-the-good-parts/">The Good Parts</a> and <a href="http://stevesouders.com/efws/">Even Faster Websites</a>.</p>
<h3>Prefer an Ext JS SPA to a classic &#8220;web app&#8221;</h3>
<p>This is a tricky one. If you have the choice, build your application in two tiers &#8211; Ext JS, and web service. They don&#8217;t even have to share the same endpoint! A cleaner design emerges when you separate the concept of the Ui and the data. If you work on a project that already muddles the two with server-side script tags and generation of Ext JS configs with &#8220;helpers&#8221;, then make it a goal to write all new code in the two-tier style. Put your Ext JS code in .js files. And only communicate with the server via JSONStores and Ajax requests.</p>
<div id="attachment_148" class="wp-caption alignright" style="width: 246px"><a href="http://github.com/jjulian/winner_picker"><img class="size-medium wp-image-148  " title="winner_picker on github" src="http://jonathanjulian.com/wp-content/uploads/2010/01/winner_picker-291x300.png" alt="jjulian/winner_picker" width="236" height="243" /></a><p class="wp-caption-text">The winner_picker UI.</p></div>
<h3>The Winner Picker App</h3>
<p>Shea brought a few copies of <a href="http://learningextjs.com/">Learning Ext JS</a>, and Jay brought a few vouchers for an early access copy of <a href="http://extjsinaction.com/">Ext JS in Action</a>. We needed a way to give them away &#8211; so, I dreamed up a simple app to randomly choose an attendee. To make it fun, I wanted to have a slick animation to randomly highlight attendees names for a few seconds before the choice is shown.</p>
<p>In less than an hour or so, here&#8217;s the Ext JS app I made: it&#8217;s a grid with an Array Store (attendees were entered manually), and one button that kicks off the process. And the silly animation: every 10ms, a grid row is selected at random and highlighted. The delay is slowly ramped down for effect. After a few seconds, the last random choice is made, and a message box is shown with the winner&#8217;s name. The<a href="http://github.com/jjulian/winner_picker"> code is on github</a>, and I encourage you to fork the project and improve it, for no other reason than practice (basic knowledge of git is <a href="http://jonathanjulian.com/2009/08/basic-git/">easy to get</a>). The Five Tips can be applied to this tiny project just as well as they can to your large enterprise project!</p>
<h3>Conclusion</h3>
<p>I think it was a successful event, and I hope to be involved in the future. There were a handful of intense discussions afterwards &#8211; it&#8217;s good to be a part of a passionate community! If you are in the Baltimore area, come on out to <a href="http://www.meetup.com/baltimore-dc-javascript-users/">our JavaScript meetup</a> and hang out with us on the first Wednesday of every month. We meet at the <a href="http://beehivebaltimore.com/">Beehive</a> in Canton. If you are in NOVA and want to help build the Ext JS meetup scene there, get in contact with Pat (<a href="http://twitter.com/sheridap">@sheridap</a>) or Jay (<a href="http://twitter.com/tdgi">@tdgi</a>).</p>
<p>I&#8217;d love to hear what you think about the Five Tips. Feel free to comment here, or on the <a href="http://www.slideshare.net/jonathanjulian/five-tips-to-improve-your-ext-js-application">slideshare page</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2010/01/five-tips-to-improve-your-ext-js-application/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>rake jslint</title>
		<link>http://jonathanjulian.com/2009/07/rake-jslint/</link>
		<comments>http://jonathanjulian.com/2009/07/rake-jslint/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 02:38:12 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=71</guid>
		<description><![CDATA[JSLint is one of the most valuable tools for a JavaScript developer. Short of being a &#8220;compiler&#8221;, it&#8217;s a &#8220;code quality tool&#8221; that can keep you from doing things that may come back to haunt you in the future. I&#8217;ll leave the detailed explanation to the author, Douglas Crockford &#8211; I assume you&#8217;re reading this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jslint.com/">JSLint</a> is one of the most valuable tools for a JavaScript developer. Short of being a &#8220;compiler&#8221;, it&#8217;s a &#8220;code quality tool&#8221; that can keep you from doing things that may come back to haunt you in the future. I&#8217;ll leave the <a href="http://www.JSLint.com/lint.html">detailed explanation</a> to the author, <a href="http://www.crockford.com/">Douglas Crockford</a> &#8211; I assume you&#8217;re reading this because you want to integrate jslint into your Rails project and run it on the command-line!</p>
<p>To run jslint as a rake task in your Rails project, you&#8217;ll only need a few things:</p>
<ul>
<li>the Java runtime</li>
<li>Rhino, the java-based javascript runtime environment</li>
<li>jslint itself</li>
<li>a rake task to invoke it</li>
</ul>
<p>So let&#8217;s get it set up. First, the java. Drop into a shell on your development system (or build system, wherever you want to run jslint), and make sure you have access to the java runtimes (run java -v, or which java). If not, <a href="http://www.java.com/en/download/index.jsp">go get it</a>. Don&#8217;t be afraid, it&#8217;s easy.</p>
<p>Next you&#8217;ll need <a href="http://www.mozilla.org/rhino/">Rhino</a>, the javascript execution environment. There are many js implementations (spidermonkey/treemonkey, v8, etc), but Rhino is the one that Crockford chose when he wrote the extension to jsunit that loads a file to be parsed. Its a jar file, <a href="http://www.mozilla.org/rhino/download.html">go get it</a> and put it into your project as vendor/rhino.jar.</p>
<p>Now you need Crockford&#8217;s jslint code. There are two parts: one is <a href="http://www.JSLint.com/fulljslint.js">jslint.js</a>, and the other is the Rhino extension (<a href="http://www.JSLint.com/rhino/rhino.js">rhino.js</a>). We will need both of these, and I&#8217;ve found it&#8217;s easiest when they are combined into one. Concatenate rhino.js to the bottom of jslint.js and save as vendor/jslint.js.</p>
<p>Hey, we&#8217;re almost there! Now you just have to add the rake task to your project.<br />
<script src="http://gist.github.com/158504.js"></script></p>
<p>Drop <a href="http://gist.github.com/raw/158504/0f20e0805e6298fba8d434f28059d5aba62b9431/jslint%20rake%20task">this gist</a> into an existing Rakefile, or rake task. If you don&#8217;t have any rake tasks, then simply save this as lib/tasks/jslint.rake. Rake will find it in your project automatically. Run rake -T to confirm.</p>
<p>A short explanation: it finds all the js files you want to inspect, and runs jslint on them one at a time, printing out failures. Line 6 is the key line &#8211; you can change two parts of this to suit your project. First, the list of files to check is created using a Dir glob. My example gets all *.js files under /public recursively (**). Then the second part of that line is used to reject js files you DO NOT want to inspect. Frameworks, 3rd party code, for example (although it can be fun to run jslint on your framework code to see <em>their</em> level of quality). This example excludes the ExtJS installation.</p>
<p>Now youre ready to run</p>
<h2>rake jslint</h2>
<p>and enjoy the benefits of quality-checking your JavaScript code! And since you&#8217;ve just built a rake task that returns 0 or 1, it can be easily integrated into you automated or continuous build process. Heh heh &#8211; now the build will fail and everyone will know who doesn&#8217;t use triple-effing-equals! (see slide 13 of <a href="http://www.slideshare.net/voodootikigod/naked-javascript">Naked JavaScript</a>)</p>
<p>Enjoy command-line jslint. And if you develop using TextMate, I highly recommend <a href="http://www.phpied.com/jslint-on-mac-textmate/">integrating jslint into that as well</a>.</p>
<p>(I&#8217;ve been thinking and talking about this for too long. Inspiration to finally get command-line jslint set up came from reading <a href="http://stackoverflow.com/questions/247209/javascript-how-do-you-organize-this-mess/248951#248951">this</a> stackoverflow earlier today.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/07/rake-jslint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: The Good Parts</title>
		<link>http://jonathanjulian.com/2009/07/javascript-the-good-parts/</link>
		<comments>http://jonathanjulian.com/2009/07/javascript-the-good-parts/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 03:36:28 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/?p=61</guid>
		<description><![CDATA[A few weeks ago, Shea Frederick asked me if I could put together a presentation for the July meeting of the Baltimore/DC JavaScript Users Group. We talked about some of the things we&#8217;ve been working on, and I mentioned that I&#8217;d been reading JavaScript: The Good Parts, an amazing book by Douglas Crockford. And a [...]]]></description>
			<content:encoded><![CDATA[<div id="__ss_1694503" style="width: 425px; text-align: left;">A few weeks ago, <a href="http://www.vinylfox.com/">Shea Frederick</a> asked me if I could put together a presentation for the <a href="http://www.meetup.com/baltimore-dc-javascript-users/calendar/10560330/">July meeting</a> of the <a href="http://www.meetup.com/baltimore-dc-javascript-users/">Baltimore/DC JavaScript Users Group</a>. We talked about some of the things we&#8217;ve been working on, and I mentioned that I&#8217;d been reading <a href="http://www.amazon.com/exec/obidos/ASIN/0596517742">JavaScript: The Good Parts</a>, an amazing book by <a href="http://www.crockford.com/">Douglas Crockford</a>. And a &#8220;book review&#8221; style presentation was born.</div>
<div style="width: 425px; text-align: left;">I decided that since the book is so dense with js knowledge, I&#8217;d just pull out my favorite takeaways and put them into a 30 minute presentation.</div>
<div style="width: 425px; text-align: left;">I didn&#8217;t spend too much time polishing the slides (or my delivery), so it came off more as a discussion than a &#8220;presentation&#8221;. It was fun. The 10 or so folks in the room chatted about the virtues of a loosely-typed language, debated about whether == is truly evil, and were truly grossed out by one of the images in the deck.</div>
<div style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="&quot;JavaScript: The Good Parts&quot; Summary" href="http://www.slideshare.net/jonathanjulian/javascript-the-good-parts-summary">&#8220;JavaScript: The Good Parts&#8221; Summary</a><object width="425" height="355" data="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=javascriptthegoodparts-090707215528-phpapp02&amp;rel=0&amp;stripped_title=javascript-the-good-parts-summary" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=javascriptthegoodparts-090707215528-phpapp02&amp;rel=0&amp;stripped_title=javascript-the-good-parts-summary" /><param name="allowfullscreen" value="true" /></object></div>
<div id="__ss_1694503" style="width: 425px; text-align: left;">
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/jonathanjulian">jonathanjulian</a>.</div>
<div id="__ss_1694503" style="width: 425px; text-align: left;">It was fun. I think next time, I&#8217;ll spend more time in <a href="http://www.mozilla.org/js/spidermonkey/">spidermonkey</a> doing some live coding, as well as showing off <a href="http://www.jslint.com/rhino/">JSLint</a> running on the cmd-line. And brush up on some language details - <a href="http://tdg-i.com/">Jay Garcia</a> schooled me on why the === works (it internally compares types before comparing values). My only regret is that I missed the jalapeno &amp; pineapple pizza.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/07/javascript-the-good-parts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ExtJS 2.2 JsonStore, HttyProxy method is case-sensitive</title>
		<link>http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/</link>
		<comments>http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:09:54 +0000</pubDate>
		<dc:creator>jonathan</dc:creator>
				<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/</guid>
		<description><![CDATA[When overriding the HTTP method from post to get on your JsonStore, the method name is case sensitive. It must be capitalized.

var store = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({url: '/data', method: 'GET'})
});

Using method: &#8216;get&#8217; does not work &#8211; it will still be an http post. This is clearly stated in the docs, but it&#8217;s too bad [...]]]></description>
			<content:encoded><![CDATA[<p>When overriding the HTTP method from post to get on your JsonStore, the method name is case sensitive. It must be capitalized.<br />
<code><br />
var store = new Ext.data.JsonStore({<br />
proxy: new Ext.data.HttpProxy({url: '/data', method: 'GET'})<br />
});<br />
</code><br />
Using method: &#8216;get&#8217; does not work &#8211; it will still be an http post. This is clearly stated in the docs, but it&#8217;s too bad it&#8217;s case-sensitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://jonathanjulian.com/2009/06/extjs-22-jsonstore-httyproxy-method-is-case-sensitive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
