javascript - app_offline.htm doesn't return response to ajax request -


i have created file app_offline.html, contents:

{    "serverunavailable":"true",    "issuetype":"maintenance",    "errormessage":"servers down maintanance, please try again later" } 

and posted server.

from app want show message server downtime.

when navigate server via google chrome see:

enter image description here

okay, cool.

but when ajax request app:

$.ajax({   // bla bola bla }) .done(function (response, textstatus, jqxhr) {   // bla bola bla }) .fail(function (xmlhttprequest, textstatus, errorthrown) {   // here want display message }); 

the xmlhttprequest properties not defined. have tried all:

response responsebody responsetype responsexml responsejson status statustext

where can find response see in browser? or missing?

this code actualy never enters fail function since request didn't fail.

when request app_offline.html file give back

{    "serverunavailable":"true",    "issuetype":"maintenance",    "errormessage":"servers down maintanance, please try again later" } 

which doesn't generate errors , stored in "response" variable of .done function.


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -