title: jQuery AJAX and functions in a CFM file
body: <p>I have been searching for this for about 3 days now and I still cannot find the proper answer to my question.</p>
  
  <p>I apologize if this question has been previously asked. Please share with me a link to the proper answer.</p>
  
  <p><strong>Question.</strong>
  Is it possible to use jQuery AJAX to call functions that are in a <code>somefile.cfm</code> (not <code>.cfc</code>)page?</p>
  
  <p>My scenario is as follows:</p>
  
  <p>I have a lot of functions in <code>somefile.cfm</code>, one of them is <code>abc</code>. I am trying the following jQuery code to call <code>function abc</code> located at <code>somefile.cfm</code>, from <code>index.cfm</code> and to get its response as a <code>json</code> string.</p>
  
  <p><strong>index.cfm</strong></p>
  
  <pre><code>...
  $.ajax({
    url: 'somefile.cfm',
    type: 'post',
    dataType: 'json',
    data: {method: abc. name: 'don'},
    success: function(res){
       alert(res);
    }
  });
  </code></pre>
  
  <p><strong>somefile.cfm</strong></p>
  
  <pre><code>&lt;cffunction name="abc" returntype="any" returnFormat="json"&gt;
    &lt;cfargument name="name" required="yes" type="string"&gt;
  
      &lt;cfset text['name'] = name&gt;
      &lt;cfset jsonvar = serializeJSON(text)&gt;
      &lt;cfreturn jsonvar&gt;
  &lt;/cffunction&gt;
  </code></pre>
  
  <p>Now when I do the call, I just get a blank response. It seems like the function is not being called. I do not get any error.</p>
  
  <p>It is possible? or do I need to convert this page to coldfusion component <code>cfc file</code>? Please help. I need your expertise.</p>
  
  <p>Thanks.</p>