title: JQuery AJAX How do I get and parse JSONP instead of JSON?
body: <p><strong>Summary</strong> <br>
  I have an application that runs a search.  Before allowing submit, it sends an AJAX call to a query to check for a valid zip code, then returns a JSON result which I can parse.  I need to do the same thing cross-domain now and I know that I have to use the full url and JSONP format instead,  but I'm not sure how to set that up.
  <br>
  <br>
  <strong>The AJAX Call</strong>
  <br>
  I send a zip code that gets run through a query.</p>
  
  <pre><code>if (zipLength == 5) {
      $.ajax({
          type:"GET", 
          //location of the cfc
          url: "cfc/test.cfc",
          //function name and url variables to send
          data: {method:'zip_lookup', zip:zip},
          //function run on success takes the returned json object and reads values.
          success: function(obj) {
              var response = $.parseJSON(obj);
  
              if (response.formError == true) {
                  alert(response.message);
              }
          }
      });
  }
  </code></pre>
  
  <p><br>
  <strong>The CFC in Coldfusion That Runs The Query</strong>
  <br></p>
  
  <pre><code>&lt;!---Makes sure entered zip exists---&gt;   
  &lt;cffunction name="zip_lookup" access="remote"&gt;
      &lt;cfquery name="qZip"&gt;
          Select Distinct ZipCode
          From zipcodes
          Where ZipCode = '#url.zip#'
      &lt;/cfquery&gt;
  
      &lt;!---Return an error if zip was not found---&gt;
      &lt;cfif qZip.RecordCount EQ 0&gt;
          &lt;cfset formError = true&gt;
          &lt;cfset message = "Invalid Zip"&gt;
      &lt;cfelse&gt;
          &lt;cfset formError = false&gt;
          &lt;cfset message = ""&gt;   
      &lt;/cfif&gt;
  
      &lt;cfoutput&gt;
          &lt;cfset obj = 
              {
                  "formError" = formError,
                  "message" = message
              } 
          /&gt;
      &lt;/cfoutput&gt;
  
      &lt;cfprocessingdirective suppresswhitespace="Yes"&gt; 
          &lt;cfoutput&gt;
              #serializeJSON(obj)#
          &lt;/cfoutput&gt;
      &lt;/cfprocessingdirective&gt;
  
      &lt;cfsetting enablecfoutputonly="No" showdebugoutput="No"&gt;
  &lt;/cffunction&gt;
  </code></pre>
  
  <p><br>
  <strong>The JSON Response</strong>
  <br>
  This is what the query returns.</p>
  
  <pre><code>{"message":"Invalid Zip","formError":true} 
  </code></pre>
  
  <p><br>
  <strong>Dealing With The Response</strong>
  <br>
  As I have above in the AJAX success function, I can grab the formError or message variables out of the JSON response.  How I can I do this with JSONP?</p>
  
  <pre><code>success: function(obj) {
      var response = $.parseJSON(obj);
  
      if (response.formError == true) {
          alert(response.message);
      }
  }
  </code></pre>
  
  <p><br>
  <br></p>