[js] fix bug encountered with IE (result evaluated to true while no response text -> json parse error) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 20 Jul 2010 14:09:58 +0200
branchstable
changeset 5998 6c148645075d
parent 5997 2d15ddbfa2d8
child 5999 eaf8219f8b7d
[js] fix bug encountered with IE (result evaluated to true while no response text -> json parse error)
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Tue Jul 20 14:08:34 2010 +0200
+++ b/web/data/cubicweb.ajax.js	Tue Jul 20 14:09:58 2010 +0200
@@ -330,7 +330,8 @@
             data: form,
             async: false
         });
-        if (result) {
+        // check result.responseText instead of result to avoid error encountered with IE
+        if (result.responseText) {
             // XXX no good reason to force json here, 
             // it should depends on request content-type
             result = cw.evalJSON(result.responseText);