Getting the CFAJAX Suggest examples to work locally
Some people have trouble getting the bundled CFAJAX suggest examples to work on their own server, even though the other examples work ok:
1) The suggest example relies on application variables, so if you don't have a cfapplication tag setup for the examples directory (perhaps in Application.cfm), do so.
2) If the other examples are working, you probaby have your paths set up correctly, but double check the javascript paths in the example file to make sure.
3) The functions.cfm file uses CGI.PATH_INFO to find the script name - this should be changed to CGI.SCRIPT_NAME, as Apache and probably some other servers don't populate CGI.PATH_INFO. You'll find this in the function getStateList() and in many other functions in the file. I also recommend CGI.HTTP_HOST rather that CGI.SERVER_NAME, because server_name can be incorrect on multi-homed servers.
Make these changes and it will work - I did it on a new install to make sure and other users have confirmed this fixes their problems.

If I put a test <cfoutput>#application.foo#</cfoutput> on top of that file and run it directly, it works fine. But if I try to return application.foo in a function with CFAJAX, I get a not defined error.
Any ideas what I'm doing wrong?
problem as Stan Cox with one of my applications. I am also using fusebox4.
Are there interoperability prolblems with fusebox 4? I included the exact
same <cfapplication> tag that I had in my index.cfm file. In trying to
figure this out, I test for IsDefined() for certain variable names and log
them to a log file. The entries in the log file have the CFID and
CFTOKEN value from variables scope are the same as what is shown in
the location bar in the IE5 browser, but the application scope variables
seem to be undefined. Here is my cfapplication tag...
<cfapplication
name="SURF"
sessionmanagement="Yes"
sessiontimeout="#CreateTimeSpan(0,0,10,0)#"
applicationTimeout="#CreateTimeSpan(0,0,10,0)#"
clientmanagement="Yes">
experimentation helped me get past the problem - at least partially. What
I would like is to have one copy of the cfajax core files shared by any
number of applications - like the fusebox4 core files can be shared. So, I
put them in their own "application" level directory (according to our
directory structure). I found the server side methods are actually part of
a different application than the invoking web page...
ApplicationName="CFAJAX1.3"
The work around I tried was to create a server scope structure. The name
of the structure is the name of the application as follows...
<cfset myAppName = #StructFind( application, "applicationname" )# >
<cflock scope="server" type="exclusive" timeout="10" >
<cfif ( #Len( myAppName )# GT 0 ) AND NOT( isDefined( "server.#myAppName#" )) >
<cfset "server.#myAppName#" = structNew() >
<cfset "server.#myAppName#.LatestActivity" = #application.LatestActivity# >
<cfset "server.#myAppName#.SessionActivity" = #application.SessionActivity# >
</cfif>
</cflock>
This seems to work, but I now have to pass the application name as a
parameter to all of my server side functions so that they will be able to
access the "published" application scope variables. Since the variables
that I will be "publishing" are all structures, I don't think too much memory
will be wasted on the server. Structures are copy by reference, I believe.
However, I am conserned that these application scope variables will
never time out. I have an application reset fuseaction that clears out
all the application specific variables. I am conserned that this might
leave behind a "reference" to the published variables that no longer exist.
Am I right to be conserned? I also may need to "publish" some session
scope variables. I am thinking of adding a structure named "Session" to
the structure named the same as the application in server scope. The
keys in the structure would be the CFTOKEN and the values would be
a structure containing any "published" session variables. This would
compound my previous concerns. This is all necessary because any
"secured" web sites must automatically time out if there is no user
activity within a certain time limit. This is because our users are in an
environment where they are frequently interrupted mid task - they get
up and walk away without closing their brower or anything. While the
windows screen should timeout and lock up and require a password to
unlock, someone has decreed that is not sufficient for "secured" web
sites. The website must log them out automatically if idle longer than the
time limit. And if they just shut down or close their browser window, they
must also be automatically logged off after the time limit. With CFAJAX,
I need to update their activity time stamp when ever a CFAJAX function
is used or they might timeout on the server while the browser does not
time out (because there is activity on the browser side). I hope you don't
mind my long winded explanation.