Another problem debugging ajaxcfc program

View: New views
1 Messages — Rating Filter:   Alert me  

Another problem debugging ajaxcfc program

by kjuliff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a Javascript froblem. You can see it in action at
http://www.gumnut.com/pub/private/ajax/index2.cfm

When I click on the button to the right of the list of names I get  an alert box that verifies that the parameter is correct and then I get the error: "message.indexOf is not a function"

I don't understand this, as the function works in the example
http://www.gumnut.com/pub/private/ajax/index.cfm

Here are the relevant javascript  functions
                  function doQueryAndJS(id)      {
                        // send data to CF
                        alert(id);
                        DWRUtil.useLoadingMessage();
                        DWREngine._execute(_ajaxConfig._cfscriptLocation, null, 'doQueryAndJS', 1, doQueryAndJSResults);
                  }

                  // call back function
                  function doQueryAndJSResults (r) {
                        // evaluate server side JS
                        eval(r);
}

and here is  the cfc code

<cffunction name="doQueryAndJS" output="no" access="private">
            <cfargument name="uid" type="numeric" required="Yes">
           
            <cfset var qReturn = '' />
            <cfset var jsReturn = '' />

            <!--- select from your query --->
            <cfquery name="qReturn" dbtype="query">
                  select * from q
                  where id = #arguments.uid#
            </cfquery>
           
            <!--- set JS commands to be executed --->
            <cfsavecontent variable="jsReturn"><cfoutput>
                  $('id').innerHTML             = '#JSStringFormat(qReturn.id)#';
                  $('fname').innerHTML       = '#JSStringFormat(qReturn.fname)#';
                  $('lname').innerHTML       = '#JSStringFormat(qReturn.lname)#';
                  $('phone').innerHTML       = '#JSStringFormat(qReturn.phone)#';
                  $('location').innerHTML = '#JSStringFormat(qReturn.location)#';
            </cfoutput></cfsavecontent>
           
            <cfreturn jsReturn />
      </cffunction>


Help me PLEASE!!

Kate
LightInTheBox - Buy quality products at wholesale price