I've been searching for a similar question to avoid asking already solved questions, but I haven't found a valid answer for me, sorry if there's one and I haven't seen it. I'm reading an XML file from Jquery, the xml file has some CDATA stuff that I have purposely added and that I would like to preserve for formatting purposes:
<?xml version="1.0" encoding="UTF-8"?>
<categories>
<description name="whatever">
Blah, blah, blah<![CDATA[<br />]]>blah, blah, blah
</description>
</categories>
After reading it, I append it to a div:
$(xml).find('description[name="whatever"]').each(function()
{
$(container).append($(this));
});
What I've got is that Jquery seems to scape the '<' and '>' so I finally have:
Blah, blah, blah&l;tbr />blah, blah, blah
I have already tried to force the appending to treat the content as text like this:
$(container).text($(this));
But then I get:
[Object object]
And if I do .html() I get the same result as with the .append()...