<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oinam&#039;s Blog &#187; Javascript</title>
	<atom:link href="http://blog.oinam.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.oinam.com</link>
	<description>All about Oinam</description>
	<lastBuildDate>Fri, 17 Oct 2008 11:27:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AjaxCFC &#8211; the Client Side</title>
		<link>http://blog.oinam.com/2006/ajaxcfc-the-client-side/</link>
		<comments>http://blog.oinam.com/2006/ajaxcfc-the-client-side/#comments</comments>
		<pubDate>Thu, 02 Feb 2006 10:02:02 +0000</pubDate>
		<dc:creator>Manaswinee</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=17</guid>
		<description><![CDATA[Ajax, ColdFusion, Javascript, AjaxCFC]]></description>
			<content:encoded><![CDATA[<p>As promised, here is a quick rundown of the client side part of <a href="http://blog.oinam.com/archives/2006/01/ajaxcfc/" title="AjaxCFC">AjaxCFC</a>.</p>

<p>The first part in the client side of AjaxCFC is to include the javascript files.</p>

<pre><code language="java">_ajaxConfig = {'_cfscriptLocation':'echoTest.cfc', '_jsscriptFolder':'js'};</code></pre>


<p><code>_ajaxConfig</code> will store the location of the listener <span class="caps">CFC </span>and location of the &#8220;js&#8221; folder which is included in the ajax.zip file that comes with AjaxCFC. The use of <code>_cfscriptLocation</code> variable is optional as you may specify the <span class="caps">CFC </span>location directly in the Ajax call.</p>

<p>You will have an ajax calling function and a call-back function; however, none of them are mandatory, because depending on your needs you may not need to know the result of your call, or you may not need to enclose your ajax call in a function.</p>

<p><span id="more-17"></span><br />
To invoke an ajax component you need to use <code>DWREngine._execute</code> which my colleague, Ashish has already <a href="http://blog.oinam.com/2006/ajaxcfc/" title="AjaxCFC">explained</a>.</p>

<p>The call-back function will always take one argument, which is the return of the method called within the <span class="caps">CFC </span>object.</p>

<p>AjaxCFC will allow you to return almost all simple or complex object to the JavaScript callback function: <em>strings, numbers, arrays, structures and queries</em>.</p>

<p>We have a preferance of structures over the other objects. The callback function will always take one argument, which is the return value of the invoked CF function.</p>

<p>The JavaScript function will receive the number or string just like any regular JavaScript call.</p>

<p>To retrieve the recordcount, you can loop your data through a built-in function, <code>result.getRowCount()</code>,&#8195;which will return the equivalent to <code>query.recordcount</code>. You can always use <code>sDumper(result)</code> to show you exactly what is being sent back to your handler.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2006/ajaxcfc-the-client-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
