Use xhr.responseType = 'json'.