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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -