<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>JavaScriptr</title>
	
	<link>http://www.javascriptr.com</link>
	<description>A blog about JavaScript and other web development technologies</description>
	<lastBuildDate>Sun, 20 Sep 2009 19:36:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Javascriptr" /><feedburner:info uri="javascriptr" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Javascriptr</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>jQuery Conference ‘09</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/oieqIFpjU8A/</link>
		<comments>http://www.javascriptr.com/2009/09/20/jquery-conference-09/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 19:34:55 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[cambridge]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[nerd]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/?p=137</guid>
		<description><![CDATA[
Last weekend I went up to Cambridge, MA for the &#8216;09 jQuery Conference. Two days of great jQuery/JavaScript goodness! I gotta say that was the best conference I&#8217;ve been to in awhile.
There were a couple presentations I had to skip but the breakout sessions more then made up for them. All in all I took [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.javascriptr.com/wp-content/uploads/2009/09/jquery_conf-1024x330.jpg" alt="the main room @ jQuery Conference" title="the main room @ jQuery Conference" width="500"  class="aligncenter size-large wp-image-150" /></p>
<p>Last weekend I went up to Cambridge, MA for the &#8216;09 jQuery Conference. Two days of great jQuery/JavaScript goodness! I gotta say that was the best conference I&#8217;ve been to in awhile.</p>
<p>There were a couple presentations I had to skip but the breakout sessions more then made up for them. All in all I took home some great tips &#038; tricks for<span id="more-137"></span>:</p>
<ul>
<li>writting efficient jQuery code</li>
<li>using custom events for single page web apps</li>
<li>speeding up page load with tools like <a href="http://labjs.com/">labjs</a></li>
<li>building iPhone apps via <a href="http://www.jqtouch.com/">jQTouch</a></li>
<li>and the biggest tip of all&#8230; get a hotel within a mile from conference</li>
</ul>
<p>The conference was held at the Microsoft New England Research &#038; Development Center aka <a href="http://microsoftcambridge.com">MS NERD</a>. Took this panoramic shot of Boston from the lunch area duing conference&#8230;<br />
<img src="http://www.javascriptr.com/wp-content/uploads/2009/09/boston_pano-1024x242.jpg" alt="view of Boston from Cambridge" title="view of Boston from Cambridge" width="500" class="size-large wp-image-138" /></p>
<p>Great venue!! The wifi was sick! Looking forward to the next event @ MS NERD Center.</p>
<p>Check out the <a href="http://events.jquery.com/jquery-conference-2009/">presentation slides</a> from the conference. Make sure you go next year!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=oieqIFpjU8A:hqcyNMuuQ78:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=oieqIFpjU8A:hqcyNMuuQ78:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=oieqIFpjU8A:hqcyNMuuQ78:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=oieqIFpjU8A:hqcyNMuuQ78:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=oieqIFpjU8A:hqcyNMuuQ78:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=oieqIFpjU8A:hqcyNMuuQ78:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=oieqIFpjU8A:hqcyNMuuQ78:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=oieqIFpjU8A:hqcyNMuuQ78:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/oieqIFpjU8A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2009/09/20/jquery-conference-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2009/09/20/jquery-conference-09/</feedburner:origLink></item>
		<item>
		<title>Setting up a JavaScript Build Process</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/TH_6rgVAJRc/</link>
		<comments>http://www.javascriptr.com/2009/07/21/setting-up-a-javascript-build-process/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 04:11:07 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Coding Practices]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[build process]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[yui]]></category>
		<category><![CDATA[yui compressor]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/?p=36</guid>
		<description><![CDATA[It&#8217;s important to have a build process for complex JavaScript applications. Probably not something you would setup for an average website. JavaScript builds are better suited for web applications &#038; script libraries. As Julien Lecomte said in his article about building web applications with Ant:
Such applications cannot efficiently be developed without relying on a solid [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s important to have a build process for complex JavaScript applications. Probably not something you would setup for an average website. JavaScript builds are better suited for web applications &#038; script libraries. As Julien Lecomte said in his <a href="http://www.julienlecomte.net/blog/2007/09/16/">article about building web applications with Ant</a>:</p>
<blockquote><p>Such applications cannot efficiently be developed without relying on a solid build process to do all the dirty and repetitive work of reliably putting all the pieces together.</p></blockquote>
<p>So its about time you setup your own build process. Julien&#8217;s blog post is great but I&#8217;m gonna start with the basics and try to give you all the info you need to get up and running asap. Everything fromorganizing the directories right down to the commands to run the build. This will help you get going with something you can build on (no pun intended!).<br />
<span id="more-36"></span><br />
Over time I&#8217;ll post more advanced task I have in my build process but for now we&#8217;ll focus on the basics. At the end of this post are some links to extra resources so you can dig into more details about the tools used here.</p>
<p><strong>Directory Structure</strong><br />
<img src="http://www.javascriptr.com/wp-content/uploads/2009/07/ant_build_dir.gif" alt="Directory Structure" title="Directory Structure" width="129" height="135" class="alignright size-full wp-image-63" style="margin-top:20px;padding:5px;border:1px solid #E9EAEA;" /></p>
<ul>
<li>
My Projects:<br />
main projects folder for all your applications &#038; libraries
</li>
<li>
sample_project:<br />
sample project we&#8217;ll use to show the build process
</li>
<li>
build:<br />
the results of a successful build. These files are what get deployed to your server(s).
</li>
<li>
src:<br />
all your source code for a project
</li>
<li>
shared:<br />
resources shared between projects
</li>
<li>
bin:<br />
all the resource files required to get your build going.
</li>
<li>
external:<br />
external code shared between projects
</li>
<li>
local:<br />
local code shared between projects
</li>
</ul>
<p><strong>Resources</strong><br />
You will need some well known development tools to get this going&#8230; here&#8217;s a list with links:<br />
<a href="http://ant.apache.org/bindownload.cgi">Ant</a> &#8211; a build tool used to manage the build process.<br />
<a href="http://www.java.com/en/download/index.jsp">Java</a> &#8211; the Java Runtime Environment is required for some other tools in build process<br />
<a href="http://yuilibrary.com/downloads/#yuicompressor">YUI Compressor</a> &#8211; tool for the compression of both JavaScript and CSS files</p>
<p>Create a folder for YUI compressor in the <em>my_projects/shared/bin</em> directory then unzip and copy over the yuicompressor-x.y.z.jar file from the download.</p>
<p><strong>Ant Build Files</strong><br />
I&#8217;m far from an Ant expert but I know enough to get a basic build going so here&#8217;s an Ant build.xml for you to experiment with. Open up your favorite text/code editor and drop this xml in there. Save it to your sample_project folder as build.xml:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">   The &lt;project&gt; tag defines the ant project and </span>
<span style="color: #808080; font-style: italic;">   the default build task to run initiated. It </span>
<span style="color: #808080; font-style: italic;">   also defines the base directory which is set</span>
<span style="color: #808080; font-style: italic;">   to the current folder this file lives in.</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sample_project&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">      The &lt;property&gt; tag defines variables we </span>
<span style="color: #808080; font-style: italic;">      are using to store the path to different </span>
<span style="color: #808080; font-style: italic;">      files and tools required and input/output </span>
<span style="color: #808080; font-style: italic;">      directories. You use those variables by</span>
<span style="color: #808080; font-style: italic;">      like this: ${variable}</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;BUILD_DIR&quot;</span>      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SOURCE_DIR&quot;</span>     <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;src&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SHARED_DIR&quot;</span>     <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;../shared&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;EXTERNAL_DIR&quot;</span>   <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${SHARED_DIR}/external&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;LOCAL_DIR&quot;</span>      <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${SHARED_DIR}/local&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;RESOURCE_DIR&quot;</span>   <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${SHARED_DIR}/bin&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;YUI_COMPRESSOR&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${RESOURCE_DIR}/yui-compressor/yuicompressor-2.4.2.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">      The &lt;target&gt; tags defines an ant task.</span>
<span style="color: #808080; font-style: italic;">      You have to give it a unique name and</span>
<span style="color: #808080; font-style: italic;">      list other task (if any) this task </span>
<span style="color: #808080; font-style: italic;">      depends on. Ant will run those task first.</span>
&nbsp;
<span style="color: #808080; font-style: italic;">      This task below is the default task defined</span>
<span style="color: #808080; font-style: italic;">      in the &lt;project&gt; tag. It will run all the</span>
<span style="color: #808080; font-style: italic;">      dependents.</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;clean, bundle_javascript, compress_javascript&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">      This is the &quot;create JavaScript bundles&quot; task</span>
<span style="color: #808080; font-style: italic;">      used to create concatenated files for each </span>
<span style="color: #808080; font-style: italic;">      category defined and a main application bundle</span>
<span style="color: #808080; font-style: italic;">      which contains all the code we need in one file.</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bundle_javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- create the output directory for built files --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bundle JavaScript Files...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- external.js: all shared third party code --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js/external.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${EXTERNAL_DIR}/js&quot;</span> <span style="color: #000066;">casesensitive</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- local.js: all shared local code --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js/local.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${LOCAL_DIR}/js&quot;</span> <span style="color: #000066;">casesensitive</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- core.js: all the core project related code --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js/core.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}/js&quot;</span> <span style="color: #000066;">casesensitive</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- main.js: the main big bundle of all the previous bundles --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js/main.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filelist</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js/&quot;</span> <span style="color: #000066;">files</span>=<span style="color: #ff0000;">&quot;external.js, local.js, core.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JavaScript Bundles Done!!!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">      This task will compress the main.js bundle using YUI </span>
<span style="color: #808080; font-style: italic;">      compressor and rename the file main.compress.js</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;compress_javascript&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;bundle_javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Compressing JavaScript Files...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;apply</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;java&quot;</span> <span style="color: #000066;">parallel</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;main.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>            
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${YUI_COMPRESSOR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>            
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;srcfile</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>            
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-o&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>            
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mapper</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;glob&quot;</span> <span style="color: #000066;">from</span>=<span style="color: #ff0000;">&quot;*.js&quot;</span> <span style="color: #000066;">to</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/js/*.compress.js&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>            
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;targetfile</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/apply<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JavaScript Compression Done!!!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">      This task will clean out any previous build files by</span>
<span style="color: #808080; font-style: italic;">      deleting the current build folder and re-creating it</span>
<span style="color: #808080; font-style: italic;">   --&gt;</span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Delete old build folder...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Create new build folder...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Go over the comments to get an idea of what&#8217;s going on in this file.</p>
<p><strong>The Process</strong><br />
So what&#8217;s the process? It&#8217;s all outlined in the Ant build file. A typical JavaScript build usually consist of code concatenation, compression and deployment to a build folder ready to get used by whatever needs to consume it. Each of these task are defined as <target/> nodes. One task can trigger others based on dependencies. So in practice, once your done coding your super cool long awaited web app and your ready to test it out&#8230; pick a build task and run the build. </p>
<p><strong>Build It!!</strong><br />
To build your app you&#8217;ll need to navigate to your project folder from the command line. The same spot where the build.xml file lives. And type &#8220;ant&#8221; then the enter key. You&#8217;ll get some output on the screen as Ant goes through each task. If it fails it you&#8217;ll get something like &#8220;Build Failed&#8230;&#8221;. Double check the build file, your folders, files, paths and all that. If the build is successful then you see something like &#8220;Build Successful&#8230;&#8221;. </p>
<p>That&#8217;s it&#8230;the build folder will have all the output files. I encourage you to play around with Ant and customize the build file to something your comfortable with. </p>
<p>You can learn more about Ant from these books:<br />
<a href="http://www.amazon.com/gp/product/0596006098?ie=UTF8&#038;tag=javascriptr-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596006098">Ant: The Definitive Guide</a><br />
<a href="http://www.amazon.com/gp/product/193239480X?ie=UTF8&#038;tag=javascriptr-20&#038;linkCode=xm2&#038;camp=1789&#038;creativeASIN=193239480X">Ant in Action</a><br />
<a href="http://www.amazon.com/gp/product/1590595599?ie=UTF8&#038;tag=javascriptr-20&#038;linkCode=xm2&#038;camp=1789&#038;creativeASIN=1590595599">Pro Apache Ant</a></p>
<p>Next time I&#8217;ll talk about creating different builds for different environments and also deploying your code to your web server.</p>
<p>Send me any questions or feedback you may have to my twitter at <a href="http://twitter.com/JavaScriptr">http://twitter.com/JavaScriptr</a> or hit me up on our <a href="http://www.javascriptr.com/contact/">contact form</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=TH_6rgVAJRc:Fyfi4zLAcLc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=TH_6rgVAJRc:Fyfi4zLAcLc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=TH_6rgVAJRc:Fyfi4zLAcLc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=TH_6rgVAJRc:Fyfi4zLAcLc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=TH_6rgVAJRc:Fyfi4zLAcLc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=TH_6rgVAJRc:Fyfi4zLAcLc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=TH_6rgVAJRc:Fyfi4zLAcLc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=TH_6rgVAJRc:Fyfi4zLAcLc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/TH_6rgVAJRc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2009/07/21/setting-up-a-javascript-build-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2009/07/21/setting-up-a-javascript-build-process/</feedburner:origLink></item>
		<item>
		<title>New design!</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/5ezdOkZy9kE/</link>
		<comments>http://www.javascriptr.com/2009/04/10/new-design/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 12:56:16 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/?p=26</guid>
		<description><![CDATA[I finally got around to updating the theme for this blog. The last theme was nice but it had too many bugs and didn&#8217;t fit well with the content. I think this design is a nice fit and I like the code behind it.
There were some minor issues and probably more to come but all [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to updating the theme for this blog. The last theme was nice but it had too many bugs and didn&#8217;t fit well with the content. I think this design is a nice fit and I like the code behind it.</p>
<p>There were some minor issues and probably more to come but all in all I&#8217;m happy with this new design. I plan on adding more features and content to this site so stay tuned.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=5ezdOkZy9kE:w1ULj3ioXQA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=5ezdOkZy9kE:w1ULj3ioXQA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=5ezdOkZy9kE:w1ULj3ioXQA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=5ezdOkZy9kE:w1ULj3ioXQA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=5ezdOkZy9kE:w1ULj3ioXQA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=5ezdOkZy9kE:w1ULj3ioXQA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=5ezdOkZy9kE:w1ULj3ioXQA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=5ezdOkZy9kE:w1ULj3ioXQA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/5ezdOkZy9kE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2009/04/10/new-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2009/04/10/new-design/</feedburner:origLink></item>
		<item>
		<title>PureJSTemplate  – A pure javascript templating engine for jQuery</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/Y2MN0DVbC_M/</link>
		<comments>http://www.javascriptr.com/2008/06/05/purejstemplate-a-pure-javascript-templating-engine-for-jquery/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 01:32:31 +0000</pubDate>
		<dc:creator>mo rock</dc:creator>
				<category><![CDATA[HTML/XHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[PureJSTemplate]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2008/06/05/purejstemplate-a-pure-javascript-templating-engine-for-jquery/</guid>
		<description><![CDATA[Most templating languages suck 
Ok, if your like me then you hate all templating langauges- they suck, they really suck. I hate them because I hate the rules they enforce upon me, they are slow, and they slow me down. Because of this, usually I end up making code that looks like this:
UGLY: 

1
2
3
4
function display&#40;data&#41; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Most templating languages suck </strong></p>
<p>Ok, if your like me then you hate all templating langauges- they suck, they really suck. I hate them because I hate the rules they enforce upon me, they are slow, and they slow me down. Because of this, usually I end up making code that looks like this:</p>
<p><strong>UGLY: </strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> display<span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> output <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&lt;div&gt;&quot;</span> <span style="color: #339933;">+</span> data.<span style="color: #660066;">text</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
   element.<span style="color: #660066;">innerHTML</span><span style="color: #339933;">=</span>output<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>How horrible is that? That&#8217;s probably worse than using a bad templating langauge.</p>
<p>Well, after disappointments with other jQuery templating plugins, I decided to make my own<span id="more-14"></span>:</p>
<p><strong>The Solution: PureJSTemplate </strong></p>
<p>With PureJSTemplate you use old fashioned javascript in your template. You simply surround the javascript in special tags. Here&#8217;s an example of what you can do:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span># <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> #<span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>#<span style="color: #339933;">=</span>i#<span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>#<span style="color: #009900;">&#125;</span>#<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>That will output the numbers 0 through 9. Easy, isn&#8217;t it?</p>
<p><strong>Using it: </strong></p>
<p>You simply surround your template code with a textarea tag:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;textarea</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;tpl&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;display:none&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- TEMPLATE CODE HERE --&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/textarea<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>and call it from javascript like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;output&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pureJSTemplate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
   id   <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;tpl&quot;</span><span style="color: #339933;">,</span>
   data <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That&#8217;s it.</p>
<p><strong> Get the Code: </strong></p>
<p>Visit a demo/benchmark page <a href="http://www.glicky.com/downloads/testtemplating_jquery.html" title="demo">here</a>. Get the js <a href="http://www.glicky.com/downloads/purejstemplate_jquery.js" title="js">here</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Y2MN0DVbC_M:P7cdkJBIhYs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Y2MN0DVbC_M:P7cdkJBIhYs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=Y2MN0DVbC_M:P7cdkJBIhYs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Y2MN0DVbC_M:P7cdkJBIhYs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=Y2MN0DVbC_M:P7cdkJBIhYs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Y2MN0DVbC_M:P7cdkJBIhYs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=Y2MN0DVbC_M:P7cdkJBIhYs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Y2MN0DVbC_M:P7cdkJBIhYs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/Y2MN0DVbC_M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2008/06/05/purejstemplate-a-pure-javascript-templating-engine-for-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2008/06/05/purejstemplate-a-pure-javascript-templating-engine-for-jquery/</feedburner:origLink></item>
		<item>
		<title>GWT + Grizzly + Comet</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/1-LtKE5BVPg/</link>
		<comments>http://www.javascriptr.com/2008/05/28/gwt-grizzly-comet/#comments</comments>
		<pubDate>Thu, 29 May 2008 01:51:57 +0000</pubDate>
		<dc:creator>mo rock</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[comet]]></category>
		<category><![CDATA[grizzly]]></category>
		<category><![CDATA[gwt]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2008/05/28/gwt-grizzly-comet/</guid>
		<description><![CDATA[Ok, so you&#8217;re probably looking for a simple example of GWT + Grizzly + Comet. Jean Francois and his buddies at JavaOne screwed us with their vague PDF. Bastards! I gotta say this, though, Jean was right, its not too hard to figure out.
This implementation uses XHR long polling, glassfishv2.ur2 and grizzly comet 1.0.9.
The problem: [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so you&#8217;re probably looking for a simple example of GWT + Grizzly + Comet. Jean Francois and his buddies at JavaOne screwed us with their vague PDF. Bastards! I gotta say this, though, Jean was right, its not too hard to figure out.</p>
<p>This implementation uses XHR long polling, glassfishv2.ur2 and grizzly comet 1.0.9.</p>
<p><strong>The problem: RemoteServiceServlet</strong></p>
<p>GWT loves POST. All RPC calls made back to your subclass of RemoteServiceServlet will hit the doPost method. However, this method is final and cannot be overridden &#8211; meaning we cannot create a comet handler for the request in our subclass of RemoteServiceServlet. We want to continue using RPC but we don&#8217;t want to use RemoteServiceServlet. WTF?</p>
<p><strong>The solution:  SimpleServiceServlet</strong></p>
<p>Pretty much the RemoteServiceServlet is too secretive. So I <span id="more-13"></span>pulled out its code and gutted it- creating SimpleServiceServlet. It&#8217;s new doPost method calls doConnect which you can override in your subclass &#8211; allowing you to create a comet handler. Yay.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CometServiceImpl <span style="color: #000000; font-weight: bold;">extends</span> SimpleServiceServlet <span style="color: #000000; font-weight: bold;">implements</span> CometService <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">public</span> CometContext cc<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> CometServiceImpl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">class</span> GWTCometHandler <span style="color: #000000; font-weight: bold;">implements</span> CometHandler<span style="color: #339933;">&lt;</span>HttpServletResponse<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span>
      ....
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> doConnect<span style="color: #009900;">&#40;</span>HttpServletRequest req, HttpServletResponse res<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
         res.<span style="color: #006633;">setContentType</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;text/html;charset=ISO-8859-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         GWTCometHandler ch <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GWTCometHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         ch.<span style="color: #006633;">attach</span><span style="color: #009900;">&#40;</span>res<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         ch.<span style="color: #006633;">attachRequest</span><span style="color: #009900;">&#40;</span>req<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         cc.<span style="color: #006633;">addCometHandler</span><span style="color: #009900;">&#40;</span>ch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;connect: e=&quot;</span> <span style="color: #339933;">+</span> e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Other issues: The RPC Thing<br />
</strong></p>
<p>GWT expects a return value from RPC methods. But what about in the case of comet? There technically isn&#8217;t an RPC method &#8211; a connection is established and then the client waits. Well, lets not re-write GWT, lets just make it happy. In traditional GWT RPC apps we extend the &#8220;RemoteService&#8221; interface that&#8217;s used by the server and the client. Let&#8217;s go ahead and do that:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> CometService <span style="color: #000000; font-weight: bold;">extends</span> RemoteService <span style="color: #009900;">&#123;</span>
   Message comet<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And lets also create the object we are going to return via comet and RPC:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Message <span style="color: #000000; font-weight: bold;">implements</span> IsSerializable<span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> text<span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setText<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> text<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">text</span><span style="color: #339933;">=</span>text<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> text<span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>So we basically follow the pattern perscribed to us by GWT &#8211; but heres the catch. In our implementation of CometService we do the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> Message comet<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Yes, we return null! This way we make GWT happy &#8211; it can continue to do all of its fancy RPC&#8217;ing. And we can do comet without any hassles. But, how do we return serialized objects to the client?</p>
<p><strong>Return serialized objects?</strong></p>
<p>We do it in our subclass of grizzly&#8217;s CometHandler -</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> GWTCometHandler <span style="color: #000000; font-weight: bold;">implements</span> CometHandler<span style="color: #339933;">&lt;</span>HttpServletResponse<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span>
   HttpServletResponse res<span style="color: #339933;">;</span>
   HttpServletRequest req<span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onEvent<span style="color: #009900;">&#40;</span>CometEvent ce<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;onEvent&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// GWTEvent event = (GWTEvent) ce.attachment();</span>
      Message msg <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Message<span style="color: #009900;">&#41;</span> ce.<span style="color: #006633;">attachment</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #666666; font-style: italic;">//LETS SERIALIZE!!!</span>
         <span style="color: #003399;">String</span> encoded <span style="color: #339933;">=</span> RPC.<span style="color: #006633;">encodeResponseForSuccess</span><span style="color: #009900;">&#40;</span>CometServiceImpl.<span style="color: #000000; font-weight: bold;">class</span>.<span style="color: #006633;">getMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;comet&quot;</span><span style="color: #009900;">&#41;</span>, msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #666666; font-style: italic;">//LETS WRITE THE RESPONSE</span>
         writeResponse<span style="color: #009900;">&#40;</span>req, res, encoded<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         removeThisFromContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">SecurityException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>SerializationException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">NoSuchMethodException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
   ......
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>The Code:</strong></p>
<p>A good sample app is worth a thousand words &#8211; <a href="http://www.glicky.com/downloads/MyProject.jar" title="MyProject.jar">download it here</a>.  This is a very simple and rough attempt at getting GWT working with Grizzly Comet. I&#8217;ll be posting an improved version at some point. It does not work in the GWT shell. You will have to deploy it to glassfish.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=1-LtKE5BVPg:NqZF_DJ-1qM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=1-LtKE5BVPg:NqZF_DJ-1qM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=1-LtKE5BVPg:NqZF_DJ-1qM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=1-LtKE5BVPg:NqZF_DJ-1qM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=1-LtKE5BVPg:NqZF_DJ-1qM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=1-LtKE5BVPg:NqZF_DJ-1qM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=1-LtKE5BVPg:NqZF_DJ-1qM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=1-LtKE5BVPg:NqZF_DJ-1qM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/1-LtKE5BVPg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2008/05/28/gwt-grizzly-comet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2008/05/28/gwt-grizzly-comet/</feedburner:origLink></item>
		<item>
		<title>Adobe Air 1.0 Released today</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/uo9vWR8twQ8/</link>
		<comments>http://www.javascriptr.com/2008/02/25/adobe-air-10-released-today/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 22:08:47 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Adobe Air]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[1.0]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[beta]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2008/02/25/adobe-air-10-released-today/</guid>
		<description><![CDATA[Adobe has officially released Air 1.0 today. I must have been under a rock somewhere. I didn&#8217;t expect this product to be out of beta anytime soon. Guess I was to busy going crazy about other products (*cough*&#8230; Jaxer). 
Its a great time to be a Javascript developer (aka a JavaScriptr). So many things going [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe has officially released Air 1.0 today. I must have been under a rock somewhere. I didn&#8217;t expect this product to be out of beta anytime soon. Guess I was to busy going crazy about other products (*cough*&#8230; Jaxer). </p>
<p>Its a great time to be a Javascript developer (aka a JavaScriptr). So many things going on. </p>
<p>Find out more about <a href="http://www.adobe.com/products/air/" target="_blank">Adobe Air here</a>. Happy Scripting!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=uo9vWR8twQ8:9qRZa3HBrDo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=uo9vWR8twQ8:9qRZa3HBrDo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=uo9vWR8twQ8:9qRZa3HBrDo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=uo9vWR8twQ8:9qRZa3HBrDo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=uo9vWR8twQ8:9qRZa3HBrDo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=uo9vWR8twQ8:9qRZa3HBrDo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=uo9vWR8twQ8:9qRZa3HBrDo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=uo9vWR8twQ8:9qRZa3HBrDo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/uo9vWR8twQ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2008/02/25/adobe-air-10-released-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2008/02/25/adobe-air-10-released-today/</feedburner:origLink></item>
		<item>
		<title>Aptana Jaxer can change the game!</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/cXpUAB4s09E/</link>
		<comments>http://www.javascriptr.com/2008/02/22/aptana-jaxer-can-change-the-game/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 15:12:16 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jaxer]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2008/02/22/aptana-jaxer-can-change-the-game/</guid>
		<description><![CDATA[What is Aptana? What is Jaxer? What does this have to do with JavaScript? Let me fill you in if you never heard these two words in the JavaScript community before.
First, what is Aptana?
Aptana Inc. is a company founded by Paul Colton back in 2005 (Paul created JRun back in the day). The company&#8217;s first [...]]]></description>
			<content:encoded><![CDATA[<p>What is Aptana? What is Jaxer? What does this have to do with JavaScript? Let me fill you in if you never heard these two words in the JavaScript community before.</p>
<p><strong>First, what is Aptana?</strong><br />
Aptana Inc. is a company founded by Paul Colton back in 2005 (Paul created JRun back in the day). The company&#8217;s first product <span id="more-11"></span>is an open source JavaScript IDE called, you guessed it, Aptana which is based on the <a href="http://www.eclipse.org/" target="_blank">Eclipse platform</a>. The IDE name was recently changed to <a href="http://www.aptana.com/studio" target="_blank">Aptana Studio</a>. It&#8217;s a pretty popular product that many JavaScript developers use. There are about 1,321,900 downloads to date according to counter on the Aptana website.</p>
<p><strong>Ok, now what is Jaxer?</strong><br />
Jaxer is the latest product from Aptana. It is &#8220;The world&#8217;s first Ajax server&#8221;. Basically its an application server that speaks JavaScript.  This means you can code your entire web application (front and back end) using JavaScript, HTML &#038; CSS only! Aptana Jaxer is also an open source project licensed under the GPL. The JavaScript and DOM engine is the same one used in Firefox 3 (Mozilla). This means you can write your code using the latest JavaScript specs (1.5 to 1.8).</p>
<p><strong>Cool! Now how will this change the game?</strong><br />
Are you kidding me? In my career as a web developer (since 1998) I&#8217;ve written code in VB, Tango, Perl, ColdFusion, Java, PHP and a bunch of unheard-of proprietary languages. The only programming language I&#8217;ve used in all my projects is JavaScript. Imagine a world where you don&#8217;t need to worry about all those other server side languages. Who needs Ruby on Rails? Why not use the most popular programming language on the web?</p>
<p>Now I know its a bit early to dump server languages like Java, PHP and ROR. Jaxer is still in beta (v0.9) and they just released a <a href="http://www.aptana.com/view/blog_front_page#/node/278" target="_blank">version for Linux</a>. So we still have a long way to go but since this is all open source, I really hope the see it take off. I plan on doing my part so look out for future articles about applications I&#8217;ll be porting over to Jaxer. </p>
<p>Read more about Jaxer at <a href="http://www.aptana.com/jaxer" target="_blank">http://www.aptana.com/jaxer</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=cXpUAB4s09E:Rf-D6B_hhW0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=cXpUAB4s09E:Rf-D6B_hhW0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=cXpUAB4s09E:Rf-D6B_hhW0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=cXpUAB4s09E:Rf-D6B_hhW0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=cXpUAB4s09E:Rf-D6B_hhW0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=cXpUAB4s09E:Rf-D6B_hhW0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=cXpUAB4s09E:Rf-D6B_hhW0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=cXpUAB4s09E:Rf-D6B_hhW0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/cXpUAB4s09E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2008/02/22/aptana-jaxer-can-change-the-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2008/02/22/aptana-jaxer-can-change-the-game/</feedburner:origLink></item>
		<item>
		<title>JQuery on Rails</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/aNCbjKB4pDM/</link>
		<comments>http://www.javascriptr.com/2008/01/05/jquery-on-rails/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 19:58:45 +0000</pubDate>
		<dc:creator>Rey</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Quick Link]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jrails]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2008/01/05/jquery-on-rails/</guid>
		<description><![CDATA[The JRails library is a useful tool for programmers working on Rails. 

jRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for JavaScript functionality using the lighter jQuery library.
I plan to start programming with Rails soon so I&#8217;ll definitely be adding this [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://ennerchi.com/projects/jrails" target="_blank">JRails</a> library is a useful tool for programmers working on Rails. </p>
<blockquote><p>
jRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for JavaScript functionality using the lighter jQuery library.</p></blockquote>
<p>I plan to start programming with Rails soon so I&#8217;ll definitely be adding this to my arsenal.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=aNCbjKB4pDM:vyJAB_Q7WeI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=aNCbjKB4pDM:vyJAB_Q7WeI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=aNCbjKB4pDM:vyJAB_Q7WeI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=aNCbjKB4pDM:vyJAB_Q7WeI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=aNCbjKB4pDM:vyJAB_Q7WeI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=aNCbjKB4pDM:vyJAB_Q7WeI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=aNCbjKB4pDM:vyJAB_Q7WeI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=aNCbjKB4pDM:vyJAB_Q7WeI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/aNCbjKB4pDM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2008/01/05/jquery-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2008/01/05/jquery-on-rails/</feedburner:origLink></item>
		<item>
		<title>Learning Adobe Air</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/Ii5ke2tLL-c/</link>
		<comments>http://www.javascriptr.com/2007/12/19/learning-adobe-air/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 23:26:13 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Adobe Air]]></category>
		<category><![CDATA[HTML/XHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Quick Link]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2007/12/19/learning-adobe-air/</guid>
		<description><![CDATA[Jonathan Snook has a great article on 24ways.org about creating an Adobe Air application using JavaScript, HTML and CSS. This is a great way for web developers who don&#8217;t know much or don&#8217;t care about Flash to get started.
I&#8217;d like to push this further by creating a desktop app that can also live on the [...]]]></description>
			<content:encoded><![CDATA[<p>Jonathan Snook has a great article on <a href="http://24ways.org" target="_blank">24ways.org</a> about creating an Adobe Air application using JavaScript, HTML and CSS. This is a great way for web developers who don&#8217;t know much or don&#8217;t care about Flash to get started.</p>
<p>I&#8217;d like to push this further by creating a desktop app that can also live on the web. Maybe even communicate with the desktop version.</p>
<p>You can check out <a href="http://24ways.org/2007/christmas-is-in-the-air" target="_blank">Snook&#8217;s article here</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Ii5ke2tLL-c:by1paT50e1c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Ii5ke2tLL-c:by1paT50e1c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=Ii5ke2tLL-c:by1paT50e1c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Ii5ke2tLL-c:by1paT50e1c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=Ii5ke2tLL-c:by1paT50e1c:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Ii5ke2tLL-c:by1paT50e1c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=Ii5ke2tLL-c:by1paT50e1c:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=Ii5ke2tLL-c:by1paT50e1c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/Ii5ke2tLL-c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2007/12/19/learning-adobe-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2007/12/19/learning-adobe-air/</feedburner:origLink></item>
		<item>
		<title>Scripting for the iPhone</title>
		<link>http://feedproxy.google.com/~r/Javascriptr/~3/piwznq2QSKM/</link>
		<comments>http://www.javascriptr.com/2007/07/12/scripting-for-the-iphone/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 23:11:27 +0000</pubDate>
		<dc:creator>Henry B.</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.javascriptr.com/2007/07/12/scripting-for-the-iphone/</guid>
		<description><![CDATA[There&#8217;s a lot of buzz in the web development community about developing for the iPhone. I&#8217;ve been following this topic since the Apple announcement last month. 
I&#8217;m all for it. This is a big step for web development on portable devices. I hope other pda and smartphone makers follow Apple&#8217;s lead. I took a quick [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a lot of buzz in the web development community about developing for the iPhone. I&#8217;ve been following this topic since the <a href="http://www.apple.com/pr/library/2007/06/11iphone.html" target="_blank">Apple announcement</a> last month. </p>
<p>I&#8217;m all for it. This is a big step for web development on portable devices. I hope other pda and smartphone makers follow Apple&#8217;s lead. I took a quick look at the <a href=" http://developer.apple.com/iphone/" target="_blank">developer documentation</a> today and found some interesting things I wanted to point out.</p>
<ul>
<li>Integrate phone calls, maps and emails using links. Mail and map links are not different from what we use on normal browsers (&#8221;mailto:anemail@domain.com&#8221; and &#8221; http://maps.google.com?address&#8221;) but phone links use a new url format which starts with &#8220;tel:&#8221;.<br />
Here&#8217;s an example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;tel:1-123-444-5555&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Call Me<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
<li>Assign an iPhone style sheet with the link tag.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> </span>
<span style="color: #009900;">  <span style="color: #000066;">media</span>=<span style="color: #ff0000;">&quot;only screen and (max-device-width: 480px)&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;iPhone.css&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>
This is new to me. Seems like its part of the CSS3 recommendation.
<li>
<li>iPhone doesn&#8217;t support window.showModalDialog(), mouse-overs, hover styles, tool tips, java applets, flash, plugin installation or custom x.509 certificates.</li>
<li>PDFs, Cookies and user-initiated window-open calls are supported but there&#8217;s a limit of 8 pages (8 open windows) in page view.</li>
</ul>
<p>Here are some iPhone third party apps:<br />
<a href="http://www.launchpadhq.com/" target="_blank">http://www.launchpadhq.com/</a><br />
<a href="http://www.37signals.com/svn/posts/502-ta-da-list-for-iphone" target="_blank">http://www.37signals.com/svn/posts/502-ta-da-list-for-iphone</a><br />
<a href="http://digg.com/iphone " target="_blank">http://digg.com/iphone </a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Javascriptr?a=piwznq2QSKM:1-oWH663tb4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=piwznq2QSKM:1-oWH663tb4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=piwznq2QSKM:1-oWH663tb4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=piwznq2QSKM:1-oWH663tb4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=piwznq2QSKM:1-oWH663tb4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=piwznq2QSKM:1-oWH663tb4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Javascriptr?i=piwznq2QSKM:1-oWH663tb4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Javascriptr?a=piwznq2QSKM:1-oWH663tb4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Javascriptr?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Javascriptr/~4/piwznq2QSKM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javascriptr.com/2007/07/12/scripting-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javascriptr.com/2007/07/12/scripting-for-the-iphone/</feedburner:origLink></item>
	</channel>
</rss>
