`xhr` doesn't exist, using this in the `.done()` function definition seems to solve it:

    .done(function(data, textStatus, jqXHR) {

`data` and `jqXHR` can then be used