[cw.ajax] fix loadxhtml documentation and warn when called on an empty elements list stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 29 Jun 2011 15:49:47 +0200
branchstable
changeset 7571 6386f802fbc6
parent 7568 c5ee33fb6a3b
child 7572 a554010417ce
[cw.ajax] fix loadxhtml documentation and warn when called on an empty elements list
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Tue Jun 28 16:32:38 2011 +0200
+++ b/web/data/cubicweb.ajax.js	Wed Jun 29 15:49:47 2011 +0200
@@ -215,7 +215,7 @@
 }
 
 /**
- * .. function:: loadxhtml(url, form, reqtype='get', mode='replace', cursor=true)
+ * .. function:: loadxhtml(url, form, reqtype='get', mode='replace', cursor=false)
  *
  * build url given by absolute or relative `url` and `form` parameters
  * (dictionary), fetch it using `reqtype` method, then evaluate the
@@ -231,7 +231,9 @@
  */
 jQuery.fn.loadxhtml = function(url, form, reqtype, mode, cursor) {
     if (this.size() > 1) {
-        cw.log('loadxhtml was called with more than one element');
+        cw.log('loadxhtml called with more than one element');
+    } else if (this.size() < 1) {
+        cw.log('loadxhtml called without an element');
     }
     var callback = null;
     if (form && form.callback) {