I can't seem to find the correct way to take some html being returned from the server, replace each ' with &apos and finally - append the new html to the DOM.
Before the modification, the below works just fine to append the html (not altered)
$(xhtml).find("#inner").appendTo("#appendTD");
But now that I want to alter the xhtml first, the below doesn't seem to work as expected
var html = $(xhtml).find("#gridFormInformation").find("'").replaceWith("'");
$(html).find("#inner").appendTo("#appendTD");
As you can see from the above, I want to replace each ' w/ the &apos inside a table element w/ the id #gridFormInformation. Part of this doesn't work because the html obj i'm trying to append is a jQuery object (not the simple string that I append in the first working example)
Any help?