diff --git a/lib/client/dom.js b/lib/client/dom.js index f410f964..ccbf7d4e 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -687,14 +687,15 @@ var CloudCmd, Util, DOM, CloudFunc; Events.add('readystatechange', function(pEvent) { if (xhr.readyState === 4 /* Complete */) { - var lJqXHR = pEvent.target, - lType = xhr.getResponseHeader('content-type'); + var lJqXHR = pEvent.target, + TYPE_JSON = 'application/json', + lType = xhr.getResponseHeader('content-type'); if (xhr.status === 200 /* OK */) { var lData = lJqXHR.response; /* If it's json - parse it as json */ - if (lType && Util.isContainStr(lType, 'application/json') ) + if (lType && Util.isContainStr(lType, TYPE_JSON) ) lData = Util.parseJSON(lJqXHR.response) || lJqXHR.response; if ( Util.isFunction(p.success) )