<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>The No-Dans Club - Javascript</title>
			<link>http://www.nodans.com/index.cfm</link>
			<description>ColdFusion, Flex, Ajax and other items of interest</description>
			<language>en-us</language>
			<pubDate>Thu, 02 Sep 2010 12:47:03 -0700</pubDate>
			<lastBuildDate>Mon, 12 Jul 2010 08:12:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>sipacate@gmail.com</managingEditor>
			<webMaster>sipacate@gmail.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>sipacate@gmail.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>console.log throws error on Internet Explorer IE</title>
				<link>http://www.nodans.com/index.cfm/2010/7/12/consolelog-throws-error-on-Internet-Explorer-IE</link>
				<description>
				
				If you have calls to console.log in your Javascript, you will get an error in Internet Explorer. This is because there is no console variable (object) in the window name space.

Sure you &lt;strong&gt;could&lt;/strong&gt; take out all your console.log statements, but usually you need those around for a little while. Here is a quick snippet you can use in JQuery that&apos;ll take the place of console.log.  Your Firefox console will still work and you won&apos;t get errors on Internet Explorer.



&lt;code&gt;
jQuery.logThis = function( text ){
	if( (window[&apos;console&apos;] !== undefined) ){
		console.log( text );
	}
}
&lt;/code&gt;

Now when you want to log something, you can use:

&lt;code&gt;
JQuery.logThis( &quot;I pity the fool who uses console.log() &quot;);
$.logThis( &quot;I pity the fool who uses Internet Explorer&quot;);
&lt;/code&gt;

&lt;h3&gt;Happy Days are here again!&lt;/h3&gt; 
				</description>
				
				<category>Javascript</category>
				
				<pubDate>Mon, 12 Jul 2010 08:12:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2010/7/12/consolelog-throws-error-on-Internet-Explorer-IE</guid>
				
				
			</item>
			
			<item>
				<title>How to customize the ColdFusion AutoSuggest</title>
				<link>http://www.nodans.com/index.cfm/2010/1/13/How-to-customize-the-ColdFusion-AutoSuggest</link>
				<description>
				
				ColdFusion 8 and 9 have an autosuggest functionality that just couldn&apos;t be simpler. 
If you want to have an autosuggest input on the screen, you can do it with a single line of code:
&lt;code&gt;
&lt;cfinput type=&quot;text&quot; name=&quot;language&quot; autosuggest=&quot;english,spanish,french&quot;&gt;
&lt;/code&gt;

That snippet will place an autosuggest box on the screen and allow a choice of english, spanish or french. Snazzy yeah? 

If you want, you can bind the autosuggest to a javascript function, or directly to a CFC, making data retrieval and formatting very simple. 

&lt;code&gt;
&lt;cfinput type=&quot;text&quot; name=&quot;language&quot; autosuggest=&quot;javascript:doSomethingJavascripty( {cfautosuggestvalue} )&quot; /&gt;
&lt;/code&gt;

&lt;code&gt;
&lt;cfinput type=&quot;text&quot; name=&quot;language&quot; autosuggest=&quot;cfc:DoSomething.coldFusiony( {cfautosuggestvalue} )&quot; /&gt;
&lt;/code&gt;

You can also make more complex examples, take a look at &lt;a href=&quot;http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f51.html&quot;&gt;the ColdFusion 9 Documentation for Autosuggest&lt;/a&gt; for some ideas.
All this is possible because ColdFusion used the extensive YUI library under the hood. The control used by the ColdFusion Autosuggest is the &lt;a href=&quot;http://developer.yahoo.com/yui/docs/YAHOO.widget.AutoComplete.html&quot;&gt;YUI AutoComplete widget&lt;/a&gt;.  

Let&apos;s say you wanted to do something that the YUI AutoComplete offers, but isn&apos;t in the ColdFusion documentation, what do you do?  [More]
				</description>
				
				<category>Ajax</category>
				
				<category>ColdFusion</category>
				
				<category>Javascript</category>
				
				<pubDate>Wed, 13 Jan 2010 07:11:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2010/1/13/How-to-customize-the-ColdFusion-AutoSuggest</guid>
				
				
			</item>
			
			<item>
				<title>A Side Effect of ySlow and Firebug</title>
				<link>http://www.nodans.com/index.cfm/2010/1/8/A-Side-Effect-of-ySlow-and-Firebug</link>
				<description>
				
				A Side Effect of ySlow and Firebug



I spent a number of hours researching a bug in a Model-Glue application. Each time a form was submitted successfully, a duplicate record showed up in the database. 
This application uses a number of frameworks and it wasn&apos;t very clear which layer was causing the problem.

I started to dig into the issue, looking for any rhyme or reason and pinged my good buddy &lt;a href=&quot;http://www.cfgrok.com&quot;&gt;Ezra Parker&lt;/a&gt; for some sanity checks.
After some intense debugging, we found out that the second record in the database showed up after the ColdFusion request ended. I tried all sorts of programmer sorcery to find out why this second request happened and did not get much useful information. This duplicate request problem defied all logic!

Through the course of working through the information and issues, we explored many potential causes and questions like:

&lt;ul&gt;
	&lt;li&gt;Was Model-Glue possibly adding a second redirect somewhere? &lt;/li&gt;
	&lt;li&gt;Was there a CFThread buried in Model-Glue, ColdSpring, Transfer or CFUniform that caused this?&lt;/li&gt;
	&lt;li&gt;Was there some javascript call being fired off, and replicating the request?&lt;/li&gt;
	&lt;li&gt;Were space hackers infiltrating my computer?&lt;/li&gt;
	&lt;li&gt;Am I on Candid Camera?&lt;/li&gt;
	&lt;li&gt;Should I just quit programming and open a Bakery?&lt;/li&gt;
&lt;/ul&gt;  [More]
				</description>
				
				<category>My Environment</category>
				
				<category>Javascript</category>
				
				<pubDate>Fri, 08 Jan 2010 07:08:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2010/1/8/A-Side-Effect-of-ySlow-and-Firebug</guid>
				
				
			</item>
			
			<item>
				<title>How to Make a Show Password Link with JQuery</title>
				<link>http://www.nodans.com/index.cfm/2009/12/4/How-to-Make-a-Show-Password-Link-with-JQuery</link>
				<description>
				
				While we all agree a good security measure is hiding passwords in form inputs, giving a user the ability to unhide the password is a nice usability feature. How often are you changing your password with nefarious people standing over your shoulder, right?

Really, the difference between markup for a text field and password field is just the type attribute of either &apos;text&apos; or &apos;password&apos;. &lt;a href=&quot;http://docs.jquery.com/Attributes/attr#keyvalue&quot;&gt;JQuery makes it easy to work with attributes&lt;/a&gt;, by the $().attr() method. So, this would seemingly be a very simple task, right? Let&apos;s try it:
&lt;code&gt;
&lt;script type=&quot;text/javascript&gt;
  oldBox.attr(&apos;type&apos;, &apos;text&apos;);
&lt;/script&gt;
&lt;/code&gt;
Whoa, this promptly results in the following error:

&lt;h3&gt;uncaught exception: type property can&apos;t be changed&lt;/h3&gt;

Ouch. That didn&apos;t work like we expected, did it?  Let&apos;s look at why. Once an element is inside the DOM, the type of the element can&apos;t be changed. The differences between the various DOM controls just mean we can&apos;t change a type of an element once it has been added. We can, however, clone the element, change the type then attach it to the DOM and it will work perfectly.  [More]
				</description>
				
				<category>Ajax</category>
				
				<category>Javascript</category>
				
				<pubDate>Fri, 04 Dec 2009 07:14:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2009/12/4/How-to-Make-a-Show-Password-Link-with-JQuery</guid>
				
				
			</item>
			
			<item>
				<title>Tip to Speed Up Your Website - Compress CSS</title>
				<link>http://www.nodans.com/index.cfm/2009/1/26/Tip-to-Speed-Up-Your-Website--Compress-CSS</link>
				<description>
				
				&lt;p&gt;
	There are a number of ways to speed up a website. An easy one would be to compress asset files and compact the files. 
	This has been widely done for Javascript files with popular tools such as &lt;a href=&quot;http://www.crockford.com/javascript/jsmin.html&quot; target=&quot;_blank&quot;&gt;JSMIN&lt;/a&gt; and &lt;a href=&quot;http://dean.edwards.name/packer/&quot; target=&quot;_blank&quot;&gt;Packer&lt;/a&gt;.
&lt;/p&gt; 
&lt;p&gt;
	The general idea behind compression/combination is to reduce the number of characters that must be sent over the wire as well as reduce the number of HTTP calls that must be made. Each time a browser gets a request to download a JS file, there is a certain amount of overhead incurred in negotiating and completing the HTTP request. Combining all JS files into one file is a great way to speed up a web application.
&lt;/p&gt;
&lt;h3&gt;Everyone Already Knows This, Right?&lt;/h3&gt;
&lt;p&gt;Probably. However, CSS files can often be as numerous and verbose as Javascript files. How come there no public outcry for CSS compression/combination?&lt;/p&gt;
&lt;p&gt;There happens to be a compressor/combinator that handles CSS files, the &lt;a href=&quot;http://developer.yahoo.com/yui/compressor/&quot; target=&quot;_blank&quot;&gt;YUI Compressor&lt;/a&gt;. For most web application developers, YUI Compressor is an annoying tool to use because, as a java application, it must be installed and run from the command line. Yuck!, right?&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.scriptalizer.com&quot; target=&quot;_blank&quot;&gt;Scriptalizer&lt;/a&gt;, developed by ColdFusion luminary &lt;a href=&quot;http://ajlcom.instantspot.com/blog/&quot; target=&quot;_blank&quot;&gt;Aaron Lynch&lt;/a&gt;, is a web front end for the YUI compressor. Scriptalizer has handled Javascript compression/combination for a while now and is a nicely designed, easy to use tool. Aaron recently added support for CSS compression/combination. Now, dealing with CSS files is as simple as dealing with JS files.&lt;/p&gt;
&lt;h3&gt;How well does it work?&lt;/h3&gt;
&lt;p&gt;I added all 14 CSS files from &lt;a href=&quot;http://thehealthchallenge.com&quot; target=&quot;_blank&quot;&gt;The Health Challenge&lt;/a&gt; and compressed/combined them with Scriptalizer. Here are the results:

&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Number of Files Before:&lt;/strong&gt; 14&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;File Size of All Files:&lt;/strong&gt; 35.42 KB&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Number of Files After:&lt;/strong&gt; 1&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;File Size of All Files:&lt;/strong&gt; 19.96 KB&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;As you can see, the reduction was significant. Not only have I cut the size of my CSS assets by ~50%, I have also removed 13 HTTP connections.&lt;/p&gt; 
				</description>
				
				<category>Wow</category>
				
				<category>Software Development</category>
				
				<category>Javascript</category>
				
				<pubDate>Mon, 26 Jan 2009 22:57:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2009/1/26/Tip-to-Speed-Up-Your-Website--Compress-CSS</guid>
				
				
			</item>
			
			<item>
				<title>Solution for JQuery Animation Content Bleeding Through</title>
				<link>http://www.nodans.com/index.cfm/2007/12/18/Solution-for-JQuery-Animation-Content-Bleeding-Through</link>
				<description>
				
				&lt;p&gt;Here is a quick tip for those using animations with the JQuery library.&lt;/p&gt;

&lt;p&gt;I just tracked down a weird issue with a JQuery Animation. The functionality of the page was very similar to an Accordion. Click an image, the content collapses using the slideDown() function. Click again, the content expands using slideUp().

The structure of the content was a table wrapped inside a container DIV: 

&lt;code&gt;
&lt;div class=&quot;SectionContainer&quot;&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;Content la la la la la &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;Not rocket science, right? This effect rendered flawlessly in Firefox shrinking and hiding the content incrementally. In I.E. 6, even though the containing div shrank incrementally, the content was visible up until the end of the animation, ruining the effect.&lt;/p&gt;

&lt;p&gt;Through Divide and Conquer, I discovered the table had a css rule &quot;position:relative&quot;. Removing this rule made the animation behave without bleeding through.&lt;/p&gt; 
				</description>
				
				<category>Javascript</category>
				
				<pubDate>Tue, 18 Dec 2007 15:42:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/12/18/Solution-for-JQuery-Animation-Content-Bleeding-Through</guid>
				
				
			</item>
			
			<item>
				<title>Running An Effect on Body Unload</title>
				<link>http://www.nodans.com/index.cfm/2007/9/25/Running-An-Effect-on-Body-Unload</link>
				<description>
				
				&lt;p&gt;I was recently asked to help with adding a page transition effect. &lt;a href=&quot;http://jquery.com/&quot; target=&quot;_new&quot;&gt;JQuery&lt;/a&gt; makes tasks like this blazingly simple. Here is the source code for fading out the body when a link is clicked:&lt;/p&gt;
&lt;code&gt;
&lt;a href=&quot;http://www.nodans.com&quot; onclick=&quot;$(document.body).fadeOut(&apos;slow&apos;)&quot;&gt;&lt;/a&gt;
&lt;/code&gt;
&lt;p&gt;Concise and snappy code! Just the way I like it! But it didn&apos;t work 100%. Would you believe the effect didn&apos;t work well in one of the browsers? &lt;/p&gt;
&lt;p&gt;When using the Firefox browser, the transition worked just fine but clicking the back button after the transition simply showed the greyed out page. Firefox browser cached the effect, rendering the whole page completely useless.&lt;/p&gt;
&lt;img src=&quot;http://www.nodans.com/images/extras/CachedGreyedPage.gif&quot; /&gt;
&lt;p&gt;
After some research, I found that the &lt;a href=&quot;http://developer.mozilla.org/en/docs/Using_Firefox_1.5_caching&quot; target=&quot;_new&quot;&gt;Firefox Browser uses a type of caching referred to as bfcache (for &quot;Back-Forward Cache&quot;)&lt;/a&gt;. BFCache is on for most cases but is not activated under the following conditions:&lt;/p&gt;

&lt;p&gt;
&lt;ul&gt;&lt;li&gt; the page uses an &lt;code&gt;unload&lt;/code&gt; handler
&lt;/li&gt;&lt;li&gt; the page sets &quot;cache-control: no-store&quot; 
&lt;/li&gt;&lt;li&gt; the page sets &quot;cache-control: no-cache&quot; and the site is HTTPS.
&lt;/li&gt;&lt;li&gt; the page is not completely loaded when the user navigates away from it
&lt;/li&gt;&lt;li&gt; the top-level page contains frames that are not cacheable
&lt;/li&gt;&lt;li&gt; the page is in a frame and the user loads a new page within that frame (in this case, when the user navigates away from the page, the content that was last loaded into the frames is what is cached) 
&lt;/li&gt;&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;The cleanest solution for this case? Add an onUnload handler to the body tag:

&lt;code&gt;
&lt;body unload=&quot;function(){return true};&quot;&gt;
&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;Now the transition works flawlessly and the back button behavior is correct. &lt;/p&gt; 
				</description>
				
				<category>Javascript</category>
				
				<pubDate>Tue, 25 Sep 2007 08:45:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/9/25/Running-An-Effect-on-Body-Unload</guid>
				
				
			</item>
			
			<item>
				<title>The New JQuery UI Launched</title>
				<link>http://www.nodans.com/index.cfm/2007/9/17/The-New-JQuery-UI-Launched</link>
				<description>
				
				&lt;p&gt;The first drop of &lt;a href=&quot;http://ui.jquery.com/&quot; target=&quot;_new&quot;&gt;JQuery UI&lt;/a&gt; was released September 16th 2007. This release includes:  [More]
				</description>
				
				<category>Ajax</category>
				
				<category>Javascript</category>
				
				<pubDate>Mon, 17 Sep 2007 09:17:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/9/17/The-New-JQuery-UI-Launched</guid>
				
				
			</item>
			
			<item>
				<title>Thanks Adobe onAir BusTour</title>
				<link>http://www.nodans.com/index.cfm/2007/8/21/Thanks-Adobe-onAir-BusTour</link>
				<description>
				
				&lt;p&gt;This past Saturday evening, the Adobe onAir Bus Tour breezed into Raleigh/Durham for a three hour stop. Mike Chambers and Kevin Hoyt gave presentations on AIR, the technology formerly known as Apollo, and the rest of the onAIR Bus Tour team took questions.&lt;/p&gt;

&lt;p&gt;Overall, I was left with the impression that jumping from Web Application Development to AIR Application Development can be very easy and the learning curve is small. By leveraging skills I already possess, HTML, Javascript, Ajax Frameworks, and Flex/ActionScript, I can create relevant cross-platform applications with all the power and reach of Native Desktop applications.&lt;/p&gt;  [More]
				</description>
				
				<category>ColdFusion</category>
				
				<category>Flex</category>
				
				<category>Javascript</category>
				
				<pubDate>Tue, 21 Aug 2007 08:02:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/8/21/Thanks-Adobe-onAir-BusTour</guid>
				
				
			</item>
			
			<item>
				<title>Solving Problems with FireBug</title>
				<link>http://www.nodans.com/index.cfm/2007/8/17/Solving-Problems-with-FireBug</link>
				<description>
				
				&lt;p&gt;&lt;a href=&quot;http://www.dkferguson.com/BlogCFC/index.cfm&quot; target=&quot;_new&quot;&gt;Dave Ferguson&lt;/a&gt; posted recently about &lt;a href=&quot;http://www.dkferguson.com/BlogCFC/index.cfm/2007/8/16/HTML-CFGRID-style-column-content&quot; target=&quot;_new&quot;&gt;HTML CFGRID style column content&lt;/a&gt; and focuses on how to style columns in an HTML CFGRID. The true gem of this post is how he used &lt;a href=&quot;http://www.getfirebug.com/&quot; target=&quot;_new&quot;&gt;Firebug&lt;/a&gt; to walk down the markup and find the class names and properties of the CFGRID output.&lt;/p&gt;

&lt;p&gt;Firebug is truly a wondrous tool. I use it every single day and I save a TREMENDOUS amount of time when working with HTML and Javascript. Also, I&apos;ve really reduced the number of times typing:

&lt;code&gt;
  alert(&apos;what is this variable &apos; + varName );
&lt;/code&gt;

or

&lt;code&gt;
  alert(&apos;Just work this time, #$*@*&amp;$&amp;!! &apos; + varName );
&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
 &lt;a href=&quot;http://www.nodans.com/index.cfm/2007/2/8/Speed-Up-Your-Client-Side-Development-Watch-the-Firebug-10Presentation-from-the-Author&quot; target=&quot;_new&quot;&gt;I wrote about Firebug previously&lt;/a&gt; and provided a link to  &lt;a href=&quot;http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1755924&quot; target=&quot;_new&quot;&gt;a Video by Joe Hewitt explaining the feature set of Firebug 1.0.&lt;/a&gt; Joe Hewitt created Firebug and does a great job showcasing the features on this video, courtesy of &lt;a href=&quot;http://developer.yahoo.com/yui/theater/&quot; target=_new&quot;&gt;YUI Theater&lt;/a&gt;. I recommend viewing this video, if you have not already.&lt;/p&gt;

&lt;p&gt;Thanks go to Dave his original post. I look forward to more great content at &lt;a href=&quot;http://www.dkferguson.com/BlogCFC/index.cfm&quot; target=&quot;_new&quot;&gt;Dave Ferguson&apos;s blog&lt;/a&gt;.&lt;/p&gt; 
				</description>
				
				<category>Ajax</category>
				
				<category>Rapid Development</category>
				
				<category>Javascript</category>
				
				<pubDate>Fri, 17 Aug 2007 13:59:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/8/17/Solving-Problems-with-FireBug</guid>
				
				
			</item>
			
			<item>
				<title>Rapid Development - Generate your drive mappings</title>
				<link>http://www.nodans.com/index.cfm/2007/6/27/Rapid-Development--Generate-your-drive-mappings</link>
				<description>
				
				&lt;p&gt;I posted a week ago about how to map a directory to a drive letter. This was a good tip for me because to get to my webroot directory, I needed to click 6 times. These 6 clicks have annoyed me for so long, I built a tool to generate the mapping scripts.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://nodans.com/tools/substitute.cfm&quot; target=&quot;_new&quot;&gt;SUBST generation tool&lt;/a&gt; uses &lt;a href=&quot;http://www.jquery.com&quot; target=&quot;_new&quot;&gt;JQuery&lt;/a&gt;. There is no technical wizardry involved, I promise. Matter of fact, all of the logic is client side, so you can view the source if you like. Building the tool seemed like a fun little morning task and I happen to have a few spare moments. I hope you like it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: I&apos;ve tested this on WinXP, if there are other steps needed for other Windows based OS&apos;s, please leave a comment and I&apos;ll add it to the program straight away.&lt;/em&gt;&lt;/p&gt; 
				</description>
				
				<category>Javascript</category>
				
				<category>Rapid Development</category>
				
				<pubDate>Wed, 27 Jun 2007 13:15:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/6/27/Rapid-Development--Generate-your-drive-mappings</guid>
				
				
			</item>
			
			<item>
				<title>Using Closures in Javascript</title>
				<link>http://www.nodans.com/index.cfm/2007/5/21/Using-Closures-in-Javascript</link>
				<description>
				
				&lt;p&gt;Closures in JavaScript are a very important tool. The ability to control the execution contexts of variables and functions gives a lot of power. In some cases, closures aren&apos;t only handy and powerful, they are necessary. For example, in the process of wrapping up a JavaScript AutoSave, I ran into a bit of a scoping problem with setTimeout(). &lt;/p&gt;

&lt;p&gt;As you know, setTimeout hangs off of the &apos;window&apos; scope. The fully qualified call is window.setTimeout(). Inside of my javascript object I created a setTimeout command to run the doSave() function. The setTimeout() function takes two arguments:

&lt;ol&gt;&lt;li&gt;The Code to execute on completion&lt;/li&gt;&lt;li&gt;The number of milliseconds before executing Arg1&lt;/li&gt;&lt;/ol&gt;
Since I was several layers inside the AutoSave object, I addressed the function as this.doSave(). The problem arose that the execution context of setTimeout means that &apos;this&apos; will not resolve into my handy doSave function. I could have addressed the function by the global variable containing my AutoSave object, but that would reduce the reusability of my JavaScript object.&lt;/p&gt;

&lt;p&gt;What I needed was a way to maintain the variables from one scope into another scope and that is where the closure came in.&lt;/p&gt;

&lt;code&gt;
startTimer : function(){
	if (! _timerRunning){
	 	var _OnTimeoutEnd =  this.doSave;
	       _timer = setTimeout ( function(){ _OnTimeoutEnd()}, _SaveCycleLength );
		_timerRunning = true;
	}
},
&lt;/code&gt;

&lt;p&gt;This piece is specifically the closure.&lt;/p&gt;
&lt;code&gt;
function(){ _OnTimeoutEnd()}
&lt;/code&gt;


&lt;p&gt;Notice above how I get a reference to the function doSave from the this scope. Inside the AutoSave object, &apos;this&apos; points to the AutoSave object. Then I set this.doSave to a new variable which I then put inside the first argument of setTimeout. &lt;/p&gt;

&lt;p&gt;When this code executes, _OnTimeoutEnd correctly resolves to the AutoSave.doSave function and the save is completed.&lt;/p&gt;

&lt;p&gt;JavaScript closures are very powerful and should become a part of your toolbox as well. If you would like to read more about Closures in JavaScript, I suggest &lt;a href=&quot;http://jibbering.com/faq/faq_notes/closures.html&quot; target=&quot;_new&quot;&gt;Javascript Closures&lt;/p&gt; by Richard Cornford.&lt;/a&gt;&lt;/p&gt; 
				</description>
				
				<category>Javascript</category>
				
				<pubDate>Mon, 21 May 2007 14:56:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/5/21/Using-Closures-in-Javascript</guid>
				
				
			</item>
			
			<item>
				<title>Debugging JS and Ajax on IE</title>
				<link>http://www.nodans.com/index.cfm/2007/5/11/Debugging-JS-and-Ajax-on-IE</link>
				<description>
				
				&lt;p&gt;I am currently working through a problem and at the point of pulling my hair out. I have an Ajax process that pops up a nice little div on success. In Firefox, predictably, I see the pop-up window and all is well. In IE, the ajax process runs and I do not get the pop-up window.&lt;/p&gt;

&lt;p&gt;Maybe I am a little spoiled using Firebug because I can see the details of the request, the DOM and other important runtime bits. In IE I get nothing useful.&lt;/p&gt;

&lt;p&gt;After writing the hundredth alert( &apos; yadda &apos; ); command, I thought I would ask the community for input. What do YOU use to debug javascript and ajax requests in IE?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. Any one who write &apos;The Microsoft Script Debugger&apos; will be taken out back and shot.&lt;/em&gt;&lt;/p&gt; 
				</description>
				
				<category>Javascript</category>
				
				<pubDate>Fri, 11 May 2007 11:20:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/5/11/Debugging-JS-and-Ajax-on-IE</guid>
				
				
			</item>
			
			<item>
				<title>JSEclipse is so much fun</title>
				<link>http://www.nodans.com/index.cfm/2007/3/13/JSEclipse-is-so-much-fun</link>
				<description>
				
				&lt;p&gt;I was digging through a bunch of javascript code today and trying to trace out some variables. In JSEclipse, an eclipse plugin made by &lt;a href=&quot;http://www.interaktonline.com&quot; target=&quot;_new&quot;&gt;Interakt&lt;/a&gt;(newly in the Adobe fold), if you highlight a variable name, or a property name, it not only highlights all instances in the file, it also places little markers for each instance on the right hand gutter of the IDE. A quick mouse click jumps right to the instance. I&apos;ve used JSEclipse for a little while now, but this was the first I noticed this handy feature.&lt;/p&gt;

&lt;p&gt;This particular JS file was well over 700 lines and I needed all the help I can get. Thank you Interakt for JSEclipse.&lt;/p&gt;

&lt;p&gt;There are plenty of other nice features in the JSEclipse plugin such as:
&lt;ol&gt;
&lt;li&gt;Contextual code completion&lt;/li&gt;
&lt;li&gt;Suggest parameters to be filled&lt;/li&gt;
&lt;li&gt;Reads all classes in current project&lt;/li&gt;
&lt;li&gt;Scan current file for words&lt;/li&gt;
&lt;li&gt;Syntax Highlighting&lt;/li&gt;
&lt;li&gt;Syntax based code folding&lt;/li&gt;
&lt;li&gt;Error reporting&lt;/li&gt;
&lt;/ol&gt;    

Get a full feature list &lt;a href=&quot;http://www.interaktonline.com/Products/Eclipse/JSEclipse/Features/&quot; target=&quot;_new&quot;&gt;here&lt;/a&gt;.


&lt;p&gt;You can get JSEclipse &lt;a href=&quot;https://www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5Fjseclipse&quot; target=&quot;_new&quot;&gt;here&lt;/a&gt;. (Registration Required).&lt;/p&gt; 
				</description>
				
				<category>Ajax</category>
				
				<category>Javascript</category>
				
				<pubDate>Tue, 13 Mar 2007 20:13:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/3/13/JSEclipse-is-so-much-fun</guid>
				
				
			</item>
			
			<item>
				<title>Speed Up Your Client Side Development. Watch the Firebug 1.0 Presentation from the Author.</title>
				<link>http://www.nodans.com/index.cfm/2007/2/8/Speed-Up-Your-Client-Side-Development-Watch-the-Firebug-10Presentation-from-the-Author</link>
				<description>
				
				&lt;p&gt;A wonderful presentation by Joe Hewitt, creator of &lt;a href=&quot;http://www.getfirebug.com/&quot; target=&quot;_new&quot;&gt;Firebug&lt;/a&gt; is available for viewing at &lt;a href=&quot;http://developer.yahoo.com/yui/theater/&quot; target=&quot;_new&quot;&gt;Yahoo Theater&lt;/a&gt;.  I use Firebug a lot when working with Javascript and Ajax and was pleased to note the new Firebug 1.0 release a few weeks ago. Firebug was already a great productivity tool in my development environment. The new features in Firebug add some real power.
&lt;/p&gt;
&lt;p&gt;
New features include:

&lt;ol&gt;
&lt;li&gt;&lt;b&gt;A Javascript profiler&lt;/b&gt; - excellent for checking the performance of your scripts.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The javascript command line&lt;/b&gt; has autocomplete for objects and properties&lt;/li&gt;
&lt;li&gt;&lt;b&gt;A dom walker&lt;/b&gt;, for inspecting elements and their properties in the DOM.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;An inline CSS editor&lt;/b&gt;- for tweaking CSS in real time. There is an interesting feature in the CSS editor where selecting a number and using the arrow keys, adjusts the numeric value. Great for keeping your eyes on the design instead of the code&lt;/li&gt;
&lt;li&gt;An amazing amount of &lt;b&gt;in-line editing and cross linked properties&lt;/b&gt;, for example, in the Javascript debugger, you can put the cursor over a variable and Firebug will show you the value of that variable at the time the breakpoint was hit.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;Rather than me banging on about how great it is, have a read directly from the source. These two links got me the most excited: &lt;br /&gt;&lt;a href=&quot;http://www.getfirebug.com/layout.html&quot; target=&quot;_new&quot;&gt;When your CSS boxes aren&apos;t lining up correctly it can be difficult to understand why. Let Firebug be your eyes and it will measure and illustrate all the offsets, margins, padding, and sizes for you.&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.getfirebug.com/js.html&quot; target=&quot;_new&quot;&gt;Firebug includes a powerful JavaScript debugger that lets you pause execution at any time and see what each variable looked like at that moment. If your code is a little sluggish, use the JavaScript profiler to measure performance and find bottlenecks fast.&lt;/a&gt;
&lt;/p&gt;
&lt;h4&gt;The video is about a hour long. A worthwhile investment.&lt;/h4&gt; 
				</description>
				
				<category>Javascript</category>
				
				<category>Rapid Development</category>
				
				<pubDate>Thu, 08 Feb 2007 21:02:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2007/2/8/Speed-Up-Your-Client-Side-Development-Watch-the-Firebug-10Presentation-from-the-Author</guid>
				
				
			</item>
			</channel></rss>