I am trying to intercept an ajax jsonp response to do some response filtering.
My guess was, I could do this with custom converters. But the converter function is never run.
What am I missing?
var ajax_options = {
dataType: 'jsonp',
jsonp: 'callback',
url: url,
data: parameters,
success: success,
converters: {
"jsonp": function (raw) {
console.log(raw);
return raw;
}
}
};
$.ajax(ajax_options);
Thanks, McFarlane
I’ve now listened to common sense and decided to not misuse the poor converters.
I’ve created a solution using $.proxy() to intercept every JSONP response while keeping the correct context in the callback function.
Because my solution heavily depends on jQueryMX I won’t paste my source here.