You should alway return HTML using the array index "template" (accessible as data.returnValues.template), as it's contents will be automatically trimmed.
If you fail to use it, make sure to either trim it server-side or use $($.parseHTML(htmlString)).
See http://jquery.com/upgrade-guide/1.9/#jquery-htmlstring-versus-jquery-selectorstring
// call child method if applicable
if ($.isFunction(this.options.success)) {
+ // trim HTML before processing, see http://jquery.com/upgrade-guide/1.9/#jquery-htmlstring-versus-jquery-selectorstring
+ if (data.returnValues && data.returnValues.template !== undefined) {
+ data.returnValues.template = $.trim(data.returnValues.template);
+ }
+
this.options.success(data, textStatus, jqXHR);
}