I'm getting an xml answer from a server using jquery and I need to have one of its child nodes as a string to further work with it. Here is my code:
function pollServer(dataObject) {
$.ajax({
type: "POST",
url: '/server.php',
data: dataObject,
success: function (data) {
$xmlDoc = $(data);
$listen = $xmlDoc.find('listen');
console.log($listen);
},
dataType: 'xml'
});
}
I already tried using (new XMLSerializer()).serializeToString(listen) but that gives me an empty string.