# HG changeset patch # User Sylvain Thénault # Date 1309355387 -7200 # Node ID 6386f802fbc60ce2f13a2343ed8237a96735f8c7 # Parent c5ee33fb6a3b374e1a0b8abeaf5de1c05e9b9cc4 [cw.ajax] fix loadxhtml documentation and warn when called on an empty elements list diff -r c5ee33fb6a3b -r 6386f802fbc6 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) {