Related Question:
http://stackoverflow.com/questions/1489402/manipulating-a-variable-containing-xml-with-jquery
I have a jsp which returns an xhtml document that looks something like this:
<root>
<p id = "myId">Text text text <img id = "myImgId" /></p>
</root>
Now, when I pull this data into a variable via an ajax call through jQuery, and then I attempt to write this data to the page, I seem to lose the object in the dom. That is, both
$('#myId')
and
$('#myId', myXmlDoc)
return []!.
I write the value to the page as such:
$('#myDiv').append($('#myId',myXmlDoc));
Also, the img starts with no source, and it is assigned in javascript dynamically via
$('#myImgId', myXmlDoc).attr( "src", "something.png" )
But when I write the img to the page (specifically a jQuery-UI popup dialog), I don't see the image, but only the text!. If I manually add the same text string to the dialog via firebug and the console, the image seems to appear. This is VERY unusual, considering the [] return values illustrated above.
Does anyone have ANY idea what's going on? This behavior is just bizarre.