Fix usage of request.status

This commit is contained in:
voussoir 2017-05-05 21:08:32 -07:00
parent 1b0495f43b
commit e5d22e766a

View file

@ -24,7 +24,6 @@ function add_album_tag(albumid, tagname, callback)
function post(url, data, callback) function post(url, data, callback)
{ {
var request = new XMLHttpRequest(); var request = new XMLHttpRequest();
request.answer = null;
request.onreadystatechange = function() request.onreadystatechange = function()
{ {
if (request.readyState == 4) if (request.readyState == 4)
@ -32,11 +31,9 @@ function post(url, data, callback)
if (callback != null) if (callback != null)
{ {
var text = request.responseText; var text = request.responseText;
console.log(request);
console.log(text);
var response = JSON.parse(text); var response = JSON.parse(text);
response["_request_url"] = url; response["_request_url"] = url;
response["_status"] = status; response["_status"] = request.status;
callback(response); callback(response);
} }
} }