<?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>Casual Rumblings - Ajax</title>
			<link>http://www.christopherchin.com/blog/index.cfm</link>
			<description>This is personal blog of a Coldfusion programmer but not limited to just geek stuff.</description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 01:35:48 -0700</pubDate>
			<lastBuildDate>Thu, 25 Mar 2010 13:48:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>chris@christopherchin.com</managingEditor>
			<webMaster>chris@christopherchin.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>chris@christopherchin.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>Casual Rumblings</title>
				<link>http://www.christopherchin.com/blog/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>HELP: CFC+jquery+JSON</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2010/3/25/HELP-CFCjqueryJSON</link>
				<description>
				
				&lt;p&gt;
Ok, I&apos;ve been at this for a couple of hours now.  I thought I was on the right track, but it looks like I&apos;m still a bit lost :(
&lt;br&gt;&lt;br&gt;
I have a modal login form using jquery and colorbox plugin.
&lt;/p&gt;
&lt;p&gt;
Here is a snippet of my jquery ajax call:
&lt;code&gt;
$j.ajax({
  url: &apos;cfc/security.cfc?method=login&apos;,
  data: datastring,
  dataType: &apos;json&apos;,
  success: function(data) {
  	var response = eval(data);
	console.log(response.MESSAGE);
    $j(&apos;.ajaxMsg&apos;).css({&quot;display&quot;:&quot;block&quot;}).html(data);
    $j.fn.colorbox.resize();
  }
});
&lt;/code&gt;
&lt;br&gt;
When calling this CFC from a URL using the correct parameters, I get this:
&lt;code&gt;{&quot;MESSAGE&quot;:&quot;Verified! Logging in...&quot;,&quot;FNAME&quot;:&quot;John&quot;,&quot;LNAME&quot;:&quot;Smith&quot;,&quot;VALID&quot;:true}
&lt;/code&gt;
This is exactly what I want.
&lt;/p&gt;
&lt;p&gt;
However, when running the ajax call above I get:
&lt;br&gt;
&lt;code&gt;
&lt;wddxPacket version=&apos;1.0&apos;&gt;&lt;header/&gt;&lt;data&gt;&lt;string&gt;{&quot;MESSAGE&quot;:&quot;Verified! Logging in....&quot;,&quot;FNAME&quot;:&quot;John&quot;,&quot;LNAME&quot;:&quot;Smith&quot;,&quot;VALID&quot;:true}&lt;/string&gt;&lt;/data&gt;&lt;/wddxPacket&gt;
&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
And this is screwing me up.
&lt;/p&gt;
&lt;p&gt;
Here is my CFC snippet:
&lt;code&gt;
&lt;CFFUNCTION name=&quot;login&quot; access=&quot;remote&quot; returntype=&quot;string&quot; output=&quot;false&quot;&gt;
    &lt;cfargument name=&quot;username&quot; type=&quot;string&quot; required=&quot;Yes&quot;&gt;
    &lt;cfargument name=&quot;password&quot; type=&quot;string&quot; required=&quot;Yes&quot;&gt;
    &lt;cfargument name=&quot;stayLogged&quot; type=&quot;string&quot; required=&quot;no&quot; default=&quot;no&quot;&gt;
	
    &lt;CFSET myReturn = {}&gt;
    .... sql statements ...
    if valid
    &lt;cfset myReturn.valid = &quot;true&quot;&gt;
    &lt;cfset myReturn.fname = #getLogin.fname#&gt;
    &lt;cfset myReturn.lname = #getLogin.lname#&gt;
    &lt;cfset myReturn.message = &quot;Verified! Logging in....&quot;&gt;
    
    if invalid
    &lt;cfset myReturn.valid = &quot;false&quot;&gt;
    &lt;cfset myReturn.fname = &quot;&quot;&gt;
    &lt;cfset myReturn.lname = &quot;&quot;&gt;
    &lt;cfset myReturn.message = &quot;Unverified! Please try signing in again.&quot;&gt;

    &lt;cfset myReturn = serializeJSON(myReturn)&gt;
	
    &lt;cfreturn myReturn&gt;
&lt;/cffunction&gt;
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
Ok...what am I doing wrong? :(
&lt;/p&gt; 
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Coldfusion</category>				
				
				<category>jQuery</category>				
				
				<pubDate>Thu, 25 Mar 2010 13:48:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2010/3/25/HELP-CFCjqueryJSON</guid>
				
			</item>
			
			<item>
				<title>jquery ajax + xml + IE = hair loss</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2009/10/26/jquery-ajax--xml--IE--hair-loss</link>
				<description>
				
				I&apos;ve done ajax before with jQuery with good results on all browsers...until
&lt;br&gt;&lt;br&gt;
I used an XML return with IE (all IE&apos;s that is).
&lt;br&gt;&lt;br&gt;
When returning XML from a CFC (or any other server-side script), IE doesn&apos;t treat the XML document as, well, XML.
&lt;br&gt;&lt;br&gt;
It actually barfs on it unless you tell it to load up the ActiveX control to parse your XML doc. (psst..Thanks Microsoft).
&lt;br&gt;&lt;br&gt;
Just look at this:
&lt;code&gt;
$.ajax({
type: &quot;POST&quot;,
url: &quot;ajaxtest.cfc?method=getallblogs&quot;,
data: datastring,
success: function(data) {
var xml;
if ( $.browser.msie ) {
xml = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);
xml.async = false;
xml.loadXML(data);
} else {
xml = data;
}
$(xml).find(&apos;blog&apos;).each(function(){
var id = $(this).attr(&apos;id&apos;);
var title = $(this).find(&apos;name&apos;).text();
var url = $(this).find(&apos;url&apos;).text();
$(&apos;&lt;div class=&quot;items&quot; id=&quot;link_&apos;+id+&apos;&quot;&gt;&lt;/div&gt;&apos;).html(&apos;&lt;a href=&quot;&apos;+url+&apos;&quot;&gt;&apos;+title+&apos;&lt;/a&gt;&apos;).appendTo(&apos;#blogInfo&apos;);
});
}
});
&lt;/code&gt;
&lt;br&gt;&lt;br&gt;
See that little blurb in the ajax call for &quot;if ($.browser.msie)&quot;?  That&apos;s the call you&apos;ll need to do to make IE behave like 99% of the other browsers out there.
&lt;br&gt;&lt;br&gt;
I&apos;ve put together a short demo.  I know the code is duplicated, but this is for demo purposes.  Hope this helps you guys doing XML data returns.
&lt;br&gt;&lt;br&gt;
Oh and once again &quot;Thank you Microsoft&quot; for making my web development career such a wild adventure.
&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.christopherchin.com/blog/demos/jquery/jqueryxmlajax.cfm&quot; target=&quot;_blank&quot;&gt;XML data return demo&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
p.s. the data returned is from my blackberry bloggers site.  If you&apos;re a blackberry fan, check it out (&lt;a href=&quot;http://www.blackberrybloggers.org&quot;&gt;http://www.blackberrybloggers.org&lt;/a&gt;).  It might look a bit familiar :) 
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Rants/Raves</category>				
				
				<category>Coldfusion</category>				
				
				<category>Javascript</category>				
				
				<category>jQuery</category>				
				
				<category>Microsoft</category>				
				
				<pubDate>Mon, 26 Oct 2009 12:01:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2009/10/26/jquery-ajax--xml--IE--hair-loss</guid>
				
			</item>
			
			<item>
				<title>jQuery + ajax + logout form</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2009/3/24/jQuery--ajax--logout-form</link>
				<description>
				
				I love jquery! Let me just say that now.  I&apos;m a true convert from prototype/scriptaculous.  I love prototype for all it&apos;s pros.  But, I can&apos;t deny the support from the jQuery community and the momentum it has in the web world.
&lt;br&gt;&lt;br&gt;
With that said, I dove in and started playing around with the jQuery UI plugin (built by the jQuery guys of course).  The dialog plug in is simply DOPE!! (is that a youngin&apos; term?)
&lt;br&gt;&lt;br&gt;
I was playing around with a logout confirmation dialog and here&apos;s what I&apos;ve come up with.  It&apos;s a bit verbose for my taste and by NO means the best way to do this.  But, I do hope it points people in the right direction if they&apos;re looking to do something like this.
&lt;br&gt;&lt;br&gt;
&lt;code&gt;
$(&apos;#logout&apos;).click(
		function(e){
		e.preventDefault();
		
        $(&apos;&lt;div id=&quot;confirmLogout&quot; title=&quot;Logout?&quot;&gt;Are you sure you want to log out?&lt;/div&gt;&apos;).dialog(
			{
			modal: true,
			height: 100, 
			width:350,
			show:&quot;blind&quot;,
			hide: &quot;blind&quot;,
			buttons:{
				&quot;Yes&quot;:function() {
					$.ajax({ 
						url: &apos;someActionCall.cfm&apos;, 
						complete: function() {
							$(&apos;#confirmLogout&apos;).html(&quot;See you next time!&quot;);
							$(&apos;.ui-dialog-buttonpane&apos;).css(&apos;display&apos;,&apos;none&apos;);
							var dlg = $(&quot;#confirmLogout&quot;).parents(&quot;.ui-dialog:first&quot;);
							dlg.animate({ width: 200},50);
							setTimeout(function(){$(&quot;#confirmLogout&quot;).dialog(&quot;close&quot;)},3000);
							setTimeout(function(){location.reload();},1500);	
							} 
						});
					},
				&quot;No&quot;:function() {
					$(&quot;#confirmLogout&quot;).dialog(&quot;close&quot;);
					}
			},
			close:function(){
				 $(&quot;#confirmLogout&quot;).remove();
			}
			});

        return false; 
	});
&lt;/code&gt;
&lt;br&gt;&lt;br&gt;
The demo can be found here:  &lt;a href=&quot;http://www.christopherchin.com/blog/demos/jquery/jquerydialog.html&quot; target=&quot;_blank&quot;&gt;Logout demo&lt;/a&gt; 
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Rants/Raves</category>				
				
				<category>Javascript</category>				
				
				<category>jQuery</category>				
				
				<pubDate>Tue, 24 Mar 2009 13:17:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2009/3/24/jQuery--ajax--logout-form</guid>
				
			</item>
			
			<item>
				<title>jQuery ajax with coldfusion</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2009/3/18/jQuery-ajax-with-coldfusion</link>
				<description>
				
				Ray Camden blogged about this recently and I thought I&apos;d take time out to do some of this jQuery/Ajaxy stuff myself.
&lt;br&gt;&lt;br&gt;
I was in the midst of trying to figure out how to to a simple login authentication process with CF8 and jQuery.&lt;br&gt;
I&apos;ve done this in the past with Prototype and this wonderful ajax library &lt;a href=&quot;http://www.lalabird.com/&quot; target=_blank&quot;&gt;JSMX&lt;/a&gt;.  Simple library to use..just love it!  But, with the times, I figured I should try this &quot;jQuery&quot; thing.  Seems to be alot of momentum behind it and there&apos;s been a lot of raves.  So I dove in.  [More]
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Javascript</category>				
				
				<pubDate>Wed, 18 Mar 2009 04:42:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2009/3/18/jQuery-ajax-with-coldfusion</guid>
				
			</item>
			
			<item>
				<title>Web 2.0 Expo 44% discount code</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2009/1/16/Web-20-Expo-44-discount-code</link>
				<description>
				
				If you&apos;re planning on attending &lt;a href=&quot;http://www.web20expo.com&quot; target=&quot;_blank&quot;&gt;Web 2.0 Expo coming up&lt;/a&gt;, you are going to want to use this discount code.
&lt;br&gt;&lt;br&gt;
Registration Promo code: &lt;b&gt;obama22&lt;/b&gt; = 44% discount.
&lt;br&gt;&lt;br&gt;
It works!  I just did a faux registration with it and the full conference pass @ $1,395 was chopped to $781.20.
&lt;br&gt;&lt;br&gt;
Not sure how long it will work (meaning time or # of uses), but get on it fast if you want to save some big bucks :) 
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Miscellaneous</category>				
				
				<category>Events</category>				
				
				<pubDate>Fri, 16 Jan 2009 14:19:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2009/1/16/Web-20-Expo-44-discount-code</guid>
				
			</item>
			
			<item>
				<title>Yahoo! Mail Beta -- frustratingly.....</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2007/12/9/Yahoo-Mail-Beta--frustratingly</link>
				<description>
				
				sloooooooow....&lt;br /&gt;&lt;br /&gt;Is Yahoo&apos;s mail beta slow due to the fact that it&apos;s trying too much to be like a desktop app or is it a ding on the weight/performance issues with ExtJS or both?&lt;br /&gt;&lt;br /&gt;I just know that it&apos;s nice eyecandy and it functions well when it&apos;s fully loaded...but you have to wait and wait (even on a full T1 pipe at my office).&lt;br /&gt;&lt;br /&gt;I&apos;m going back to the original quick version.&amp;nbsp; I don&apos;t need that kinda eye candy.&amp;nbsp; I&apos;ll leave that up to Outlook.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=&quot;poweredbyperformancing&quot;&gt;Powered by &lt;a href=&quot;http://scribefire.com/&quot;&gt;ScribeFire&lt;/a&gt;.&lt;/p&gt; 
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Rants/Raves</category>				
				
				<category>Javascript</category>				
				
				<pubDate>Sun, 09 Dec 2007 17:51:24 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2007/12/9/Yahoo-Mail-Beta--frustratingly</guid>
				
			</item>
			
			<item>
				<title>Autocomplete + InPlaceEditor + Proto/Scriptaculous...finally!!</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2007/11/25/Autocomplete--InPlaceEditor--ProtoScriptaculousfinally</link>
				<description>
				
				&lt;p&gt;
I blogged a while back about trying to mash up Spry/Prototype/Scriptaculous to do an inplace-edit and an autocomplete.  Unfortunately, I lost a bit of momentum using Spry for this purpose because we&apos;re not using Spry in the office.
&lt;/p&gt;
&lt;p&gt;
I picked up the ball to use just Prototype/Scriptaculous for our needs.
What I found out was that there was a bit of a disconnect with Scriptaculous&apos; Ajax.Autocompleter and Ajax.InPlaceEditor (to complete what I needed done).
&lt;/p&gt;
&lt;p&gt;
What I needed: The ability to Add a Tag to a profile with InPlaceEditor but, I didn&apos;t want to have multiple versions of the same tag.  (Ex. Dog, Dogs, Doggie)  I needed to give the person who&apos;s inputting a new tag the ability to see tags that are similar to what he/she is currently typing.
&lt;/p&gt;
&lt;p&gt;
Scriptaculous&apos; Ajax.InPlaceEditor builds a form with an input or a textarea on the fly when you click on a link.  Awesome!  The only issue is that the &lt;code&gt;&lt;input&gt; or &lt;textarea&gt;&lt;/code&gt; code doesn&apos;t include an ID for the html element created.  The disconnect is that Autocomplete needs to target an INPUT&apos;s ID name.
&lt;/p&gt;
&lt;p&gt;
With this knowledge, I had to make a change to Scriptaculous&apos; library: contols.js.  I am using the latest 1.8.0 version, so here is where I made my change at around line 551:
&lt;code&gt;
createEditField: function() {
...
fld.id = this.options.formId + &apos;_input&apos;;
...
  }
&lt;/code&gt;
After making this change, viewing the generated javascript (god I love the web developer add-on for Firefox), I can see my form&apos;s dynamically generated input field, now has an ID.  YAY!!!
&lt;/p&gt;
&lt;p&gt;
Now I can continue with the Ajax.Autocompleter to target the INPUT field. But wait...There&apos;s a hangup :(
&lt;/p&gt;
&lt;p&gt;
The generated form and the autocomplete execute almost simultaneously and there&apos;s an error.  My Ajax.Autocompleter is complaining that the INPUT field that I am targetting doesn&apos;t exist?  Huh? Doesn&apos;t exist? OH YEAH!!  Need to do this in sequence :)  My fix was to put a short setTimeOut function to execute the autocomplete library AFTER the INPUT field has been generated.
&lt;/p&gt;
&lt;p&gt;PHEW!!  What a pain that was.  But, hey, I learned alot with this little exercise.  I&apos;m almost certain that someone out there has done this before and probably did it better than me.  If so, please point me in that direction :)

Here&apos;s the demo: &lt;a href=&quot;http://www.christopherchin.com/sandbox/autocompleteinplacedit.html&quot; target=&quot;newWindow&quot;&gt;Ajax.Autocompleter + Ajax.InPlaceEditor&lt;/a&gt;&lt;br&gt;
(Try: Chris or phil or Boot or Hal) 
				</description>
				
				<category>Ajax</category>				
				
				<category>Web20</category>				
				
				<category>Coldfusion</category>				
				
				<category>Javascript</category>				
				
				<pubDate>Sun, 25 Nov 2007 15:21:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2007/11/25/Autocomplete--InPlaceEditor--ProtoScriptaculousfinally</guid>
				
			</item>
			
			<item>
				<title>Spry + Autocomplete + InPlaceEditing...anyone?</title>
				<link>http://www.christopherchin.com/blog/index.cfm/2007/11/13/Spry--Autocomplete--InPlaceEditinganyone</link>
				<description>
				
				&lt;p&gt;I have been trying to use Spry&apos;s autocomplete with &lt;a href=&quot;http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor&quot; target=&quot;newWindow&quot;&gt;Prototype Ajax.InPlaceEdit&lt;/a&gt; function but can&apos;t seem to see how to integrate the 2.
&lt;/p&gt;
&lt;p&gt;
I have successfully added Prototypes Ajax.InplaceEdit with &lt;a href=&quot;http://www.codeproject.com/jscript/jsactb.asp&quot; target=&quot;newWindow2&quot;&gt;ACTB javascript&lt;/a&gt;  (see if I can get a link up later to this sample).
&lt;/p&gt;
&lt;p&gt;If anyone has done this or knows how to combine InPlaceEditing with Autocompleting (spry and prototype), please reply :)&lt;/p&gt;
&lt;p&gt;I&apos;m surprised at 2 things.  1) Spry hasn&apos;t added InPlaceEditing (along with drag/drop) 2)Combining the 2 to begin with and having a demo up somewhere.  I&apos;m sure I&apos;m not the only one who needs this combo.&lt;/p&gt;
&lt;p&gt;In the meantime, I&apos;ll be plugging away at this and see if I can frankenstein the 2.&lt;/p&gt; 
				</description>
				
				<category>Ajax</category>				
				
				<category>Spry</category>				
				
				<category>Technology</category>				
				
				<category>Web20</category>				
				
				<category>CSS</category>				
				
				<category>Javascript</category>				
				
				<pubDate>Tue, 13 Nov 2007 20:30:00 -0700</pubDate>
				<guid>http://www.christopherchin.com/blog/index.cfm/2007/11/13/Spry--Autocomplete--InPlaceEditinganyone</guid>
				
			</item>
			</channel></rss>