title: Simulate a JSONP response with JavaScript URLs
body: <p>I'm using Gravity Forms on a WP site. My forms POST via ajax to <a href="https://www.pardot.com/" rel="noreferrer">Pardot</a> using Pardot <a href="https://www.pardot.com/blog/form-handlers-forms-tips-tricks-switching/" rel="noreferrer">form handlers</a>. I am running into an issue where Pardot processes the form 6x, with no other errors. Research indicates that this is because Pardot does not support CORS or JSONP, and thus gets stuck in a loop when using ajax to submit. It's processing the submission but never "finishing" when the form handler's Success URL is set as referring URL. It tries 6x before giving up, processing the submitted data and sending new prospect notification emails each time.</p>
  
  <p>Pardot <a href="https://help.salesforce.com/articleView?id=000264418&amp;language=en_US&amp;type=1" rel="noreferrer">help docs</a> suggest the following solution:</p>
  
  <blockquote>
    <p>It is possible to simulate a JSONP response by setting the Success and Error URLs for the form handler to be JavaScript URLs that execute Success and Error callbacks, respectively.</p>
  </blockquote>
  
  <p>I'm not totally sure what this means or how to approach it. I've done some stackoverflowing and googling, but I can't seem to wrap my head around how to do it. Can someone help clarify this concept or point me in the right direction?</p>
  
  <p>Thanks!</p>