I’m getting data from a remote server, that can produce JSONP but needs the callback-function name in a non-standard way.
For code structure & simpler error-handling, I’d prefer to use the default function. Is there a way for me to get the autogenerated function name, and give that as a data-parameter?
What I’d like to be able to do is something in the lines of:
$.ajax("http://mydomain.com/xxx",
{
dataType: "jsonp",
type : 'GET',
success : function(response) {
doSomething(response);
},
data: {
format_options : 'callback:' + jQueryAutoGeneratedCallbackFunction,
outputFormat : 'json'
}
}
);
Is this possible?
..So it turns out I thinking it from a wrong angle.
The answer is, that I can change the “callback”-parameter like this.
Just as clarification, the “callback:”-part in “callback:myFunction” is needed just for the API i’m using, I included it here as i’d included it in the question.