Casey Flynn Casey Flynn - 1 year ago 83
Ajax Question

jQuery .ajax() with jsonp not invoking success callback function

I have a facebook iframe application that makes a cross domain request to my server and requests data in JSONP format. This is my client side code:

url: '***',
type: 'post',
data: {
method: 'set_user_prizes'
dataType: 'jsonp',
jsonp: false,
jsonpCallbackString: 'callback123',
success: function(data, textStatus, jqXHR){

The problem is my success callback method isn't being invoked and I'm not sure why. Using Firebug I can see my server's response:


Answer Source

Remove the word String from the callback key as is illustrated in the following transformation. The value needs to remain a string.


jsonpCallbackString: 'callback123',


jsonpCallback: 'callback123',
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download