title: Javascript function not returning value
body: <p>I am calling a function with the following code:</p>
  <pre><code>var resultz = nsEditor.updateStringCall(debtID, column2Change, value2Change, 4, 10);
  </code></pre>
  <p>The function that is being called but doesn't return a value</p>
  <pre class="lang-js prettyprint-override"><code>updateStringCall: function(pdebtID, pcolumn2Change, pvalue2Change, pmin, pmax){
      try {
          var resultz2 = 0;
          $.ajax({
              type: &quot;POST&quot;,
              url: &quot;Components/MintLibraries.cfc&quot;,
              dataType: &quot;json&quot;,
              cache: false,
              data: {
                  method: 'StringUpdate',
                  val2Change: pvalue2Change.trim(),
                  debtID: pdebtID,
                  column2Change: pcolumn2Change,
                  greaterThan: pmin,
                  lesserThan: pmax,
                  returnFormat: &quot;json&quot;
              },
              success: function(response) {
                  resultz2 = 1;
                  return resultz2;
              },  //end done
              error: function(jqXHR, textStatus, errorThrown){
                  resultz2 = 0;
                  return resultz2;
          }); //end ajax call
      } catch (e) {
          resultz2 = 0;
          return resultz2;
      }  //end trycatch
  }, // end updateStringCall
  </code></pre>
  <p>This function uses the .ajax to call a coldfusion cfc method StringUpdate:</p>
  <pre><code>&lt;cffunction name=&quot;StringUpdate&quot; access=&quot;remote&quot; output=&quot;false&quot; returntype=&quot;any&quot; &gt;    
       &lt;cfargument name=&quot;val2Change&quot; type=&quot;string&quot;  required=&quot;true&quot; /&gt;
       &lt;cfargument name=&quot;debtID&quot;  type=&quot;string&quot;  required=&quot;true&quot; /&gt;
       &lt;cfargument name=&quot;column2Change&quot;  type=&quot;string&quot;  required=&quot;true&quot; /&gt;
       &lt;cfargument name=&quot;greaterThan&quot;  type=&quot;numeric&quot;   required=&quot;false&quot; /&gt;
       &lt;cfargument name=&quot;lesserThan&quot;  type=&quot;numeric&quot;  required=&quot;false&quot; /&gt;
       &lt;cfset var debt2Pass = int(val(arguments.debtID)) /&gt;
       &lt;cfset var updQuery = &quot;&quot; /&gt;
       &lt;cfset var retValue = 0 /&gt;
       &lt;cfset var iVal = 0 /&gt;&lt;cfset var valError = '' /&gt;
      &lt;cftry&gt;
       
          &lt;cfquery name=&quot;updQuery&quot; datasource=&quot;#application.datasource#&quot; result=&quot;qResults&quot;    &gt;
                  Update dmf set #arguments.column2Change# =
                   &lt;cfqueryparam cfsqltype=&quot;cf_sql_varchar&quot; value=&quot;#arguments.val2Change#&quot;/&gt;
                   where DebtID = 
                   &lt;cfqueryparam cfsqltype=&quot;cf_sql_smallint&quot; value=&quot;#arguments.debtID#&quot;/&gt;
          &lt;/cfquery&gt; 
          &lt;cfset retValue = 1 /&gt;    
       &lt;cfcatch type=&quot;Any&quot; &gt;
                  &lt;cfset thrown = ThrowCFError(405,'debug',  'Error updating ' &amp;  arguments.DebtID,arguments.val2Change &amp; ', ' &amp;  arguments.debtID &amp; ',' &amp; arguments.column2Change)  /&gt;
                    &lt;cfset retValue = 0 /&gt;
           &lt;/cfcatch&gt;
           &lt;/cftry&gt;
      &lt;cfreturn retValue /&gt;
  &lt;/cffunction&gt;
  </code></pre>
  <p>The query runs successfully but the js function doesn't return a value (it shows up as undefined).  Even if it gets an error, I would think I have accounted enough for that to at least get a return value.</p>
  <p>Ideas?</p>