Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>success</code> callback method is called when the server responds. The <code>$.ajax</code> method sets up a function that handles the response by calling the <code>success</code> callback method.</p> <p>The most likely reason that the <code>success</code> method is not called, is that the response from the server is not correct. The <code>$.ajax</code> method sends a value in the <code>callback</code> query string that the server should use as function name in the JSONP response. If the server is using a different name, the function that the <code>$.ajax</code> method has set up is never called.</p> <p>If the server can not use the value in the <code>callback</code> query string to set the function name in the response, you can specify what function name the <code>$.ajax</code> method should expect from the server. Add the property <code>jsonpCallback</code> to the option object, and set the value to the name of the function that the server uses in the response.</p> <p>If for example the <code>$.ajax</code> method is sending a request to the server using the URL <code>http://service.mydomain.com/getdata?callback=jsonp12345</code>, the server should respond with something looking like:</p> <pre><code>jsonp12345({...}); </code></pre> <p>If the server ignores the <code>callback</code> query string, and instead responds with something like:</p> <pre><code>mycallback({...}); </code></pre> <p>Then you will have to override the function name by adding a property to the options object:</p> <pre><code>$.ajax({ url: urlOnDiffDomain, dataType: 'jsonp', data: {}, success: function(data, textStatus) { alert('success...'); }, jsonpCallback: 'mycallback' }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload