I’m using the Google Closure Library for a large scale web app. Basically I am sending a cross domain request to get some JSON data from a server. The data is returned properly and everything works just fine, but the function specified as an error_callback for the JSONP.send method still fires and I cannot understand why.
This is the code that fires the JSONP request.
JSONPhandler.send({
action: 'getAllPublishers', start: 0, length: 15},
goog.bind(function(callback) {
progressBar.setValue(100);
goog.style.showElement(progressBarContainer, false);
goog.dom.append(this.mainViewPublications,
initItems.call(this, callback));
}, this), errorHandler.displayError('UNKNOWN'));
If the server response type for a JSONP request is not application/json, the error callback is never fired:)