Synchronize with Etiquette.
This commit is contained in:
parent
741cddc2e4
commit
34aafedf46
1 changed files with 13 additions and 5 deletions
|
@ -18,15 +18,23 @@ function _request(method, url, callback)
|
||||||
if (callback == null)
|
if (callback == null)
|
||||||
{return;}
|
{return;}
|
||||||
|
|
||||||
if (request.status != 0)
|
|
||||||
{
|
|
||||||
response.completed = true;
|
|
||||||
response.data = JSON.parse(request.responseText);
|
|
||||||
}
|
|
||||||
response.meta = {
|
response.meta = {
|
||||||
"request_url": url,
|
"request_url": url,
|
||||||
"status": request.status
|
"status": request.status
|
||||||
}
|
}
|
||||||
|
if (request.status != 0)
|
||||||
|
{
|
||||||
|
response.completed = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.data = JSON.parse(request.responseText);
|
||||||
|
response.meta.json_ok = true;
|
||||||
|
}
|
||||||
|
catch (exc)
|
||||||
|
{
|
||||||
|
response.meta.json_ok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
callback(response);
|
callback(response);
|
||||||
};
|
};
|
||||||
const asynchronous = true;
|
const asynchronous = true;
|
||||||
|
|
Loading…
Reference in a new issue