do postprocessing as in the xhtml case fix #345293 stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 01 Sep 2009 11:02:31 +0200
branchstable
changeset 3073 09c6fe0db381
parent 3070 b1c3626ce20a
child 3074 141cfaac6b97
do postprocessing as in the xhtml case fix #345293
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Mon Aug 31 18:55:59 2009 +0200
+++ b/web/data/cubicweb.ajax.js	Tue Sep 01 11:02:31 2009 +0200
@@ -390,9 +390,10 @@
 /* convenience function that returns a DOM node based on req's result. */
 function getDomFromResponse(response) {
     if (typeof(response) == 'string') {
-	return html2dom(response);
+	var doc = html2dom(response);
+    } else {
+        var doc = response.documentElement;
     }
-    var doc = response.documentElement;
     var children = doc.childNodes;
     if (!children.length) {
 	// no child (error cases) => return the whole document