jquery/jquery — pull request #993 by james-huston (2012-10-16 21:18:16+00:00)
Title: parseJSON to match throws on JSON.parse on errors ticket #12751

See ticket: http://bugs.jquery.com/ticket/12751

This patch changes functionality of parseJSON to make it match JSON.parse in how it handles empty strings. This now throws instead of returning null.

This create a change in .ajax in how an empty return value from the server is handled. Before this patch if the dataType was json and the server returned an empty string you would end up in :success and need to error check the result to make sure it's not null. After this patch you will end up in :error because you actually got bad json back from the server.