<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>David Harris&apos;s Technology Blog - jQuery</title>
			<link>http://www.harrisfamily.net.nz/devblog/index.cfm</link>
			<description>ColdFusion, Flex and the Universe...</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 06:30:30 -0500</pubDate>
			<lastBuildDate>Thu, 03 Jul 2008 12:41:00 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>harrisfamily.net.nz@gmail.com</managingEditor>
			<webMaster>harrisfamily.net.nz@gmail.com</webMaster>
			
			<item>
				<title>Adventures in jQuery</title>
				<link>http://www.harrisfamily.net.nz/devblog/index.cfm/2008/7/3/Adventures-in-jQuery</link>
				<description>
				
				The last week or so I&apos;ve had the pleasure of working deeply with &lt;a&gt;http://jquery.com/,jQuery&lt;/a&gt;.

And I mean that, it&apos;s been a pleasure.

Once you get used to the &apos;style&apos; of how it works, it makes sense and has a consistent coding experience.

I&apos;ve worked mainly with the core and the ui.jquery libraries, with fileupload thrown in.
In the mix is also &lt;cfajaxproxy&gt;, and they have all played together nicely (so far!)

I&apos;ve got jQuery adding and removing custom DOM elements on the fly, while updating information on the server, uploading and deleting images and also maintaining the structure of the form so that when it is submitted in the usual &quot;post&quot; manner, the server knows what to do with the data it receives.

So all in all I&apos;ve had a good experience with it.

Things it has helped me understand is the use of &quot;anonymous Functions&quot; (I think that is what they are called)

EG:
&lt;code&gt;
$(&quot;#myelement&quot;).hide();
&lt;/code&gt;
will hide the element with the id of &quot;myelement&quot;

now the &quot;hide&quot; method will accept an argument of a function that it will call when it has completed.
Commonly called a &quot;callback&quot;, so i we had a function like this:
&lt;code&gt;
function alertme(){ alert(&apos;me&apos;); }
&lt;/code&gt;
you could call that function when hide was complete like this:
&lt;code&gt;
$(&quot;#myelement&quot;).hide( alertme ); 
&lt;/code&gt;
so the function has the name &quot;alertme&quot;, so is not anonymous.

To use an anonymous function to do the same thing, this is what you would do:
&lt;code&gt;
$(&quot;#myelement&quot;).hide( function(){ alert(&apos;me&apos;); } );
&lt;/code&gt;


You can also do this in Flex.

eg:

rather than:
&lt;code&gt;
addEventListener( &quot;SomeEvent&quot; , someFunction );
&lt;/code&gt;
You can go:
&lt;code&gt; 
addEventListener( &quot;someEvent&quot; , function( event: Event): void { [do stuff here] } );
&lt;/code&gt;
While you can put as much in you function as you like, I did find it makes code a bit hard to read.

One thing that works, but somehow feels wrong, is that the anonymous functions have direct access to the variables declared in the calling function.

eg:
&lt;code&gt;
function myFunction()
{

	var someString = &quot;bob&quot;;
	$(&quot;#myelement&quot;).hide( function(){ alert( someString ); } );

}
&lt;/code&gt;
This seems to be true of both JS and AS.
I guess this is because the function itself belongs to the function it is being called in, so has access to the variables called in there...

So all in all I&apos;ve enjoyed getting to know &lt;a&gt;http://jquery.com/,jQuery&lt;/a&gt;, and suspect it&apos;s the beginning of a beautiful friendship!

&lt;small&gt;...but, I still prefer Flex!&lt;/small&gt; 
				</description>
				
				<category>jQuery</category>				
				
				<category>Ajax</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Thu, 03 Jul 2008 12:41:00 -0500</pubDate>
				<guid>http://www.harrisfamily.net.nz/devblog/index.cfm/2008/7/3/Adventures-in-jQuery</guid>
				
			</item>
			</channel></rss>