web/data/cubicweb.ajax.js
branch3.5
changeset 3084 096d680c9da2
parent 3075 e9b7cd2e9012
parent 3073 09c6fe0db381
child 3103 1d09765ee720
--- a/web/data/cubicweb.ajax.js	Tue Sep 01 18:45:50 2009 +0200
+++ b/web/data/cubicweb.ajax.js	Wed Sep 02 10:23:38 2009 +0200
@@ -395,9 +395,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