Here's a follow-up concerning the results in Firebug from running the 
tutorial,
"Quickstart..."

In the Response tab of Firebug, after clicking the "Load Response" 
button in the
Response tab, I get the property response, but further down, after 
considerable
whitespace, I get this long code, which seems to be returned due to an error
in processing, denoted by the Firebug error message:
"invalid flag after regular expression   jquery.js (line 110)"  Realize 
that I'm using
the original tutorial's jquery.js file, which I've linked to in 
"dinner.cfm"...

Why would I get this error and not the tutorial?

</td></td></td></th></th></th></tr></tr></tr></table></table></table></a></abbrev></acronym></address

></applet></au></b></banner></big></blink></blockquote></bq></caption></center></cite></code></comment

></del></dfn></dir></div></div></dl></em></fig></fn></font></form></frame></frameset></h1></h2></h3>

</h4></h5></h6></head></i></ins></kbd></listing></map></marquee></menu></multicol></nobr></noframes>

</noscript></note></ol></p></param></person></plaintext></pre></q></s></samp></script></select></small

></strike></strong></sub></sup></table></td></textarea></th></title></tr></tt></u></ul></var></wbr><

/xmp>

<style type="text/css">

..cfdebug

{

        color:black; 

        background-color:white; 

        font-family:"Times New Roman", Times, serif; 

        font-size:small

}

..cfdebuglge

{

        color:black; 

        background-color:white; 

        font-family:"Times New Roman", Times, serif; 

        font-size:medium;

}

a.cfdebuglink {color:blue; background-color:white }

</style>

<table class="cfdebug" bgcolor="white">

<tr>

        <td>

        

                <p class="cfdebug"><hr/>

                <b class="cfdebuglge"><a name="cfdebug_top">Debugging 
Information</a></b>

                <table class="cfdebug">

                <tr>

                        <td class="cfdebug" nowrap>ColdFusion Server 
Developer</td>

                        <td class="cfdebug">8,0,0,176276</td>

                </tr>

                <tr>

                        <td class="cfdebug" nowrap> Template </td>

                        <td 
class="cfdebug">/wsm-dev/jquery/jquery_cf_ajax/request_processor.cfm</td>

                </tr>

                <tr>

                        <td class="cfdebug" nowrap> Time Stamp </td>

                        <td class="cfdebug">06-Dec-08 02:10 PM</td>

                </tr>

                <tr>

                        <td class="cfdebug" nowrap> Locale </td>

                        <td class="cfdebug">English (US)</td>

                </tr>

                <tr>

                        <td class="cfdebug" nowrap> User Agent </td>

                        <td class="cfdebug">Mozilla/5.0 (Windows; U; Windows NT 
5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox

/3.0.4 ColdFire/1.2.51.70</td>

                </tr>

                <tr>

                        <td class="cfdebug" nowrap> Remote IP </td>

                        <td class="cfdebug">127.0.0.1</td>

                </tr>

                <tr>

                        <td class="cfdebug" nowrap> Host Name </td>

                        <td class="cfdebug">127.0.0.1</td>

                </tr>

                </table>

                </p>

                

                        <style type="text/css">

            .template

            {   color: black; 

                font-family: "Times New Roman", Times, serif; 

                font-weight: normal; }

            .template_overage

            {   color: red; 

                background-color: white; 

                font-family: "Times New Roman", Times, serif; 

                font-weight: bold; }

            </style>

                <p class="cfdebug"><hr/><b class="cfdebuglge"><a 
name="cfdebug_execution">Execution Time</a

></b></p>

            <a name="cfdebug_templates">

        

                <table border="1" cellpadding="2" cellspacing="0" 
class="cfdebug">

                <tr>

                                        <td class="cfdebug" 
align="center"><b>Total Time</b></td>

                                        <td class="cfdebug" 
align="center"><b>Avg Time</b></td>

                                        <td class="cfdebug" 
align="center"><b>Count</b></td>

                                        <td class="cfdebug"><b>Template</b></td>

                                </tr>

                

                        

                        

                        

                        

                            

                        

    

                        <tr>

                                                        

                                <td align="right" class="cfdebug" nowrap>16 
ms</td>

                                                        

                            <td align="right" class="cfdebug" nowrap>16 ms</td>

                            <td align="center" class="cfdebug" nowrap>1</td>

                            <td align="left" class="cfdebug" nowrap>CFC[ 
E:\Inetpub\webroot\wsm-dev\jQuery

\jquery_cf_ajax\menudata.cfc | getmenuData(3) ] from 
E:\Inetpub\webroot\wsm-dev\jQuery\jquery_cf_ajax

\menudata.cfc</td>

                        </tr>

                        

                        

                        

                        

                        

                            

                                                         

                        

    

                        <tr>

                                                        

                                <td align="right" class="cfdebug" nowrap>16 
ms</td>

                                                        

                            <td align="right" class="cfdebug" nowrap>16 ms</td>

                            <td align="center" class="cfdebug" nowrap>1</td>

                            <td align="left" class="cfdebug" nowrap><img 
src='/CFIDE/debug/images/topdoc

..gif' alt='top level' border='0'> 
<b>E:\Inetpub\webroot\wsm-dev\jQuery\jquery_cf_ajax\request_processor

..cfm</b></td>

                        </tr>

                        

                        

                        

                        

                        

                            

                        

    

                        <tr>

                                                        

                                <td align="right" class="cfdebug" nowrap>0 
ms</td>

                                                        

                            <td align="right" class="cfdebug" nowrap>0 ms</td>

                            <td align="center" class="cfdebug" nowrap>1</td>

                            <td align="left" class="cfdebug" nowrap>CFC[ 
E:\Inetpub\webroot\wsm-dev\jQuery

\jquery_cf_ajax\cfjson.cfc | encode([complex value]) ] from 
E:\Inetpub\webroot\wsm-dev\jQuery\jquery_cf_ajax

\cfjson.cfc</td>

                        </tr>

                        

                <tr>

                                        <td align="right" class="cfdebug" 
nowrap><i>16 ms</i></td><td colspan=2>&nbsp;</td>

                    <td align="left" class="cfdebug"><i>STARTUP, PARSING, 
COMPILING, LOADING, &amp; SHUTDOWN

</i></td>

                                </tr>

                <tr>

                                        <td align="right" class="cfdebug" 
nowrap><i>32 ms</i></td><td colspan=2>&nbsp;</td>

                    <td align="left" class="cfdebug"><i>TOTAL EXECUTION 
TIME</i></td>

                                </tr>

                </table>

                <font color="red"><span class="template_overage">red = over 250 
ms average execution

 time</span></font>

                </a>

                

        

                <p class="cfdebug"><hr/><b class="cfdebuglge"><a 
name="cfdebug_sql">SQL Queries</a></b></p>

                

                        <code><b>get_menu</b> (Datasource=menudb, Time=16ms, 
Records=1) in E:\Inetpub\webroot\wsm-dev\jQuery

\jquery_cf_ajax\menudata.cfc @ 14:10:38.038</code><br />

                        <pre>

                

                        select          menu.day, menu.main_dish

                        from            menu

                        where           menu.qsid = 3

                        

                </pre>

                        

                        

                

        

<p class="cfdebug"><hr/><b class="cfdebuglge"><a name="cfdebug_scopevars">Scope 
Variables</a></b></p

>

<pre><b>CGI Variables:</b>

AUTH_PASSWORD=

AUTH_TYPE=

AUTH_USER=

CERT_COOKIE=

CERT_FLAGS=

CERT_ISSUER=

CERT_KEYSIZE=

CERT_SECRETKEYSIZE=

CERT_SERIALNUMBER=

CERT_SERVER_ISSUER=

CERT_SERVER_SUBJECT=

CERT_SUBJECT=

CF_TEMPLATE_PATH=E:\Inetpub\webroot\wsm-dev\jQuery\jquery_cf_ajax\request_processor.cfm

CONTENT_LENGTH=5

CONTENT_TYPE=application/x-www-form-urlencoded; charset=UTF-8

CONTEXT_PATH=

GATEWAY_INTERFACE=CGI/1.1

HTTPS=off

HTTPS_KEYSIZE=

HTTPS_SECRETKEYSIZE=

HTTPS_SERVER_ISSUER=

HTTPS_SERVER_SUBJECT=

HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP_ACCEPT_ENCODING=gzip,deflate

HTTP_ACCEPT_LANGUAGE=en-us

HTTP_CONNECTION=keep-alive

HTTP_COOKIE=CFID=13190; CFTOKEN=66689096

HTTP_HOST=localhost

HTTP_REFERER=http://localhost/wsm-dev/jquery/jquery_cf_ajax/dinner.cfm

HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) 
Gecko/2008102920 Firefox

/3.0.4 ColdFire/1.2.51.70

PATH_INFO=/wsm-dev/jquery/jquery_cf_ajax/request_processor.cfm

PATH_TRANSLATED=E:\Inetpub\webroot\wsm-dev\jQuery\jquery_cf_ajax\request_processor.cfm

QUERY_STRING=

REMOTE_ADDR=127.0.0.1

REMOTE_HOST=127.0.0.1

REMOTE_USER=

REQUEST_METHOD=POST

SCRIPT_NAME=/wsm-dev/jquery/jquery_cf_ajax/request_processor.cfm

SERVER_NAME=localhost

SERVER_PORT=80

SERVER_PORT_SECURE=0

SERVER_PROTOCOL=HTTP/1.1

SERVER_SOFTWARE=Microsoft-IIS/5.1

WEB_SERVER_API=

</pre>

<pre><b>Cookie Variables:</b>

CFID=13190

CFTOKEN=66689096

</pre>

<pre><b>Form Fields:</b>

FIELDNAMES=IDM

IDM=3

</pre>

<pre><b>Server Variables:</b>

COLDFUSION=Struct (8)

OS=Struct (5)

</pre>

<font size="-1" class="cfdebug"><i>Debug Rendering Time: 78 ms</i></font><br />

        </td>

</tr>

</table>





Rick Faircloth wrote:
> Hi, all...
>
> I've been trying to wrap my head around using CF-jQuery-AJAX for awhile,
> but just can't seem to get anything working.
>
> I've looked at examples everywhere...on 365labs.net and the tutorial,
> "Quickstart Guide to ColdFusion+jQuery Ajax" to the jQuery site, itself,
> and also the AJAX_CFC site by Rob Gonda.
>
> The "Quickstart..." tutorial, mentioned above, got me close, but I can't 
> figure out the error I'm getting
> and how to fix it.  I'm using Firebug, but I don't know how to respond 
> to the feedback
> it's providing.
>
> Let me just ask this straight up:  Is there a "complete" tutorial, with 
> *every* single character
> of code provided, including the HTML, etc., that I can walk through and 
> get working?
> If I can find such a tutorial, I'm can change out the parts with my own 
> and begin to understand
> and make Ajax work.
>
> (Or perhaps someone would be interested in coding a *complete* working 
> example for a wishlist gift?
> Christmas is coming, you know... :o)
>
> I'd really *love* to find a simple "login" form that checks email and 
> password against a database.
> I find a *lot* of examples how to use PHP and jQuery to do that, but I 
> need jQuery and ColdFusion.
>
> By the way..has Ajax_CFC been abandoned?  All the info is from 2007 and 
> is over a year old...
>
> Now, if anyone can provide a link to an online tutorial such described 
> above that would be great.
>
> I'm also going to provide all the code I'm using for the "Quickstart 
> Guide to ColdFusion+jQuery Ajax"
> that is currently throwing an error, and include the Firebug error 
> messages if anyone cares to go
> beyond this point in this email.
>
> Thanks for any help!
>
> Rick
>
>
> Here's the code for all the pages involved with Rob's tutorial, 
> including Firebug's error messages, if
> anyone cares to look at it...
>
>
>
>
> When I run my html page (dinner.cfm), I select a day, but nothing happens.
> (btw, the demo for this tutorial is at:
>
>
> In the Firebug console, I'm getting these messages.
>
> When I select the day from the input Firebug responds:
>
> X 1 Error
>
> "POST 
> http://localhost/wsm-dev/jquery/jquery_cf_ajax/request_processor.cfm";     
> jquery.js (line 1)
> X invalid flag after regular expression     jquery.js (line 110)
> </td></td></td></th></th></th></tr></tr>...></dir></div</div></dl></em></fig></fn>
>  
>
>
> Then when I click on "POST http://localhost..."; etc., to view the 
> Headers/Post/Response tabs messages,
> under Post I get "idm 2", which looks right...
> under Reponse I get
>
>
> Firebug needs to POST to the server to get this information for url:
> *http://localhost/wsm-dev/jquery/jquery_cf_ajax/request_processor.cfm*
>
> "This second POST can interfere with some sites. If you want to send the 
> POST again, open a new tab in Firefox, use URL 'about:config', set 
> boolean value 'extensions.firebug.allowDoublePost' to true "
> "This value is reset every time you restart Firefox This problem will 
> disappear when https://bugzilla.mozilla.org/show_bug.cgi?id=430155 is 
> shipped."
>
>
>
> Then below that text, when I click the "Load Reponse" button, I see:
>
> {"main_dish":"Spaghetti","day":"Tuesday"}
>
> which looks correct...
>
>
> Here are the files I'm using:
>
> dinner.cfm 
> _______________________________________________________________________________
>  
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>     
> <html xmlns="http://www.w3.org/1999/xhtml";>
>
> <cfsetting showdebugoutput="no">
>
> <head>
>
>     <script language="JavaScript" 
> src="http://www.365labs.net/cf_jquery/jquery.js"; 
> type="text/javascript"></script>
>     
>     <script type="text/javascript">
>     
>         $(document).ready(function(){            
>             $('#contentdiv').html('&nbsp;');
>            
>                 $("#idm").change(function(){
>                     var formval = { idm:$(this).val()};
>                
>                     $.ajax({
>                                   type: "POST",
>                                   url: "request_processor.cfm",
>                                   dataType: "json",
>                                   data: formval,
>                                   success: function(response){
>                                                               
> $('#contentdiv').fadeIn(2000).append(response.MAIN_DISH);
>                                                               }
>                             });       
>                 });           
>         });
>        
>     </script>
>     
>     
>     <style type="text/css">
>     
>          body         { font-family: Arial, Helvetica, sans-serif; }
>          #databox     { border: 1px solid Gray;                        
> margin:30px auto 0px auto;
>                        padding: 10px;                        width: 200px;}
>         #contentdiv { color:red; font-size: 30px;  margin-top: 10px;}
>        
>     </style>
>     
> </head>
>
> <body>
>
>     <div align="center" id="databox">
>     
>         <select id="idm">
>             <option value="0" SELECTED>What's for Dinner?...</option>
>             <option value="1">Monday</option>
>             <option value="2">Tuesday</option>
>             <option value="3">Wednesday</option>
>             <option value="4">Thursday</option>
>             <option value="5">Friday</option>
>             <option value="6">Saturday</option>
>         </select>
>                
>         <p id="contentdiv"> </p>
>        
>     </div>
>     
>     
>     
>     
> </body>
>
> </html>
>
>
>
>
> request_processor.cfm 
> ___________________________________________________________________________________
>  
>
>
>     <cfset odata = createObject("component","menudata")>
>     <cfset thedata = odata.getmenuData(FORM.idm)>
>     <cfset ojson = createObject("component","cfjson")>
>     <cfset theresults = ojson.encode(thedata)>
>     <cfoutput>#theresults#</cfoutput>
>
>
>
>
> menudata.cfc 
> ___________________________________________________________________________________________
>  
>
>
> <cfcomponent displayname="menudata" hint="Contains database query" 
> output="false">
>
>     <cffunction name = "getMenuData">
>     
>         <cfargument name = "menu_id" required="yes">
>        
>         <cfquery name="get_menu" datasource="menudb">
>        
>             select          menu.day, menu.main_dish
>             from          menu
>             where        menu.qsid = #arguments.menu_id#
>            
>         </cfquery>
>        
>         <cfset pstruct = structNew()>
>         <cfset pstruct.day = get_menu.day>
>         <cfset pstruct.main_dish = get_menu.main_dish>
>        
>         <cfreturn pstruct>
>        
>     </cffunction>
>
> </cfcomponent>
>
>
>
>
> cfjson.cfc 
> _____________________________________________________________________________________________________
>  
>
>
>
> (I won't replicate that here...)
>
>
> Can you spot where I'm going wrong?
> I can put my attempt online if that would help...
>
>
> Thanks for the help!
>
> Rick
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316386
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to