angular/angular.js — pull request #7031 by caitp (2014-04-07 17:14:47+00:00)
Title: fix($httpBackend): don't error when JSONP callback called with no parameter

This change brings Angular's JSONP behaviour closer in line with jQuery's. It
will no longer treat a callback called with no data as an error, and will no
longer support IE8 via the onreadystatechanged event.

BREAKING CHANGE:

Previously, the JSONP backend code would support IE8 by relying on the
readystatechanged events. This is no longer the case, as these events do not
provide adequate useful information for deeming whether or not a response is
an error.

Previously, a JSONP response which did not pass data into the callback would
be given a status of -2, and treated as an error. Now, this situation will
instead be given a status of 200, despite the lack of data. This is useful for
interaction with certain APIs.

Previously, the onload and onerror callbacks were added to the JSONP script
tag. These have been replaced with jQuery events, in order to gain access to
the event object. This means that it is now difficult to test if the callbacks
are registered or not. This is possible with jQuery, using the
$.data("events") method, however it is currently impossible with jqLite. This
is not expected to break applications.

Closes #4987 Closes #6735