# HG changeset patch # User Aurelien Campeas # Date 1251979697 -7200 # Node ID 1d09765ee7200ded62bf41be6d30b45b4152fe49 # Parent e75ab3635f0795a58c29fc900205b4f25f11b16e# Parent f2c4da6b008d5fb26518ba5d547d3a19093bd8d2 backport stable diff -r e75ab3635f07 -r 1d09765ee720 web/data/cubicweb.ajax.js --- a/web/data/cubicweb.ajax.js Wed Sep 02 18:10:36 2009 +0200 +++ b/web/data/cubicweb.ajax.js Thu Sep 03 14:08:17 2009 +0200 @@ -402,15 +402,18 @@ var children = doc.childNodes; if (!children.length) { // no child (error cases) => return the whole document - return doc.cloneNode(true); + return jQuery(doc).clone().context; } children = stripEmptyTextNodes(children); if (children.length == 1) { // only one child => return it - return children[0].cloneNode(true); + return jQuery(children[0]).clone().context; } // several children => wrap them in a single node and return the wrap - return DIV(null, map(methodcaller('cloneNode', true), children)); + return DIV(null, map(function(node) { + return jQuery(node).clone().context; + }, + children)); } function postJSON(url, data, callback) {