From a4a04eaf0cf2cf0a1ee23d7d4c148f898c077c5a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Sep 2013 14:12:16 +0000 Subject: [PATCH] fix(dom) Loader ajax: add dataType --- lib/client/dom.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index ccbf7d4e..8b3fc1e5 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -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;