I am doing ajax POST and when it succeded I would like to replace current div with div from succeded ajax:
var dom;
var target;
$.ajax({
type: "POST",
url: "http://127.0.0.1/participants",
data: "action=addparticipant&userid=1",
success: function (html) {
dom = $.parseHTML(html);
target = $(dom).find("#listParticipants").val();
$('#listParticipants').html(target);
}
});
but it seems that target is empty...
and when I debug using firebug, than dom is:
[<TextNode textContent="\n\n">, <TextNode textContent="\n\n">,
div#listParticipants, <TextNode textContent="\n \n \n">,
<TextNode textContent="\n\n">, <TextNode textContent="\n\n">]
Could anyone help me solve this problem?
Regards