Fix usage of request.status
This commit is contained in:
parent
1b0495f43b
commit
e5d22e766a
1 changed files with 1 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue