fix(dom) Loader ajax: add dataType

This commit is contained in:
coderaiser 2013-09-19 14:12:16 +00:00
parent aba5107ac0
commit a4a04eaf0c

View file

@ -694,9 +694,10 @@ var CloudCmd, Util, DOM, CloudFunc;
if (xhr.status === 200 /* OK */) {
var lData = lJqXHR.response;
/* If it's json - parse it as json */
if (lType && Util.isContainStr(lType, TYPE_JSON) )
lData = Util.parseJSON(lJqXHR.response) || lJqXHR.response;
if (p.dataType !== 'text')
/* If it's json - parse it as json */
if (lType && Util.isContainStr(lType, TYPE_JSON) )
lData = Util.parseJSON(lJqXHR.response) || lJqXHR.response;
if ( Util.isFunction(p.success) )
p.success(lData, lJqXHR.statusText, lJqXHR);
@ -1381,7 +1382,9 @@ var CloudCmd, Util, DOM, CloudFunc;
if ( this.isCurrentIsDir(lCurrentFile) )
lPath += '?json';
lPath += '?json';
else
lParams.dataType = 'text';
if (!lParams.url)
lParams.url = CloudFunc.FS + lPath;