3 Replies Latest reply on Aug 14, 2011 2:15 PM by Evik.James

    Getting throw new SyntaxError("parseJSON"); cfajax.js (line 803)


      First of all, I have looked through forums and have found others with similar problems, but i have tested all their recommendations and still no success.  So i'm hoping someone can help. I'll try to provide as much information as possible.


      So being new to working with Ajax, im trying to make an ajax call from a .cfm to a .cfc using cfajaxproxy, which is where i keep getting this error.  My cfm is a form that produces a checklist based on the user.  As each checkbox is checked, i want a call to the cfc to run a function, make queries etc.  As of right now, when the user selects a check box the information is being passed to the javascript, but there is no response from the cfc function and i keep getting the mentioned error in firebug.


      -I have tried creating a copy of my cfc in the wwwroot folder and giving it blank data (cffunction named whatever, cfargument named nothing set to  "") and use the extends parameter pointing to the out-of-root CFC, but that doesnt work



      -There is nothing outputting any html comment in my cfc as mentioned in




      <cfajaxproxy cfc="orientation_funcs" jsclassname="orientation_funcs" />
      <html xmlns="http://www.w3.org/1999/xhtml">
              <link rel="stylesheet" type="text/css" href="orientation.css" />
              <title>Ryerson Orientation - Main Page</title>
              <script type="text/javascript">       
                      function updateEvent(eventId){
                      var instance = new orientation_funcs();
                      alert("after calling the method");



      <cfform action="orientation_login_process.cfm" method="POST">
                      <cfoutput query="scheduleOfEvents">
                          <!--- Table displaying the various orientation events available to the student --->
                          <table class="center">



                          <td style="width:5%;">
                                      <cfinput type="checkbox" id="eventSelect_#event_Id#" name="eventSelect" value="#event_id#" onclick="updateEvent(#event_id#)">
                                  <!--- <cfif #completed# is 'F'>
                                      <td style="width:5%;">
                                          <cfinput type="checkbox" name="eventSelect" value="#event_id#">
                                  <cfelseif #completed# is 'T'>
                                      <td style="width:5%;">
                                          <cfinput type="checkbox" name="eventSelect" value="#event_id#" checked="True" readonly="true">
                                  </cfif> --->
                  <cfinput type="submit" name="Save" value="Save Progress">


      .cfc (in the same folder as the .cfm)

      <cfcomponent displayname="orientation_funcs"


      <cffunction name="test" access="remote" output="false" returnFormat="JSON" hint="">
              <cfargument name="ev" type="string" required="yes">

                     alert("inside cfc function");



      .cfc (in the wwwroot folder)

      <cfcomponent displayname="orientation_funcs"

        <cffunction name="whatever" access="remote" hint="" >
              <cfargument name="nothing" default="">



      So what happens now is, when i select the checkbox on the form, the initial alert message in updateEvent(eventID) function appears, but the message inside the cfc function does not get produced.  In firebug, the "throw new SyntaxError("parseJSON"); appears.  Any help or suggestions would be greatly appreciated and thanks in advance.