Reputation: 1315
I am getting json response from server through ajax call. One parameter in json contain xml. But when i set the content of that parameter to div it is not showing xml data. How can i show the xml content in div and if possible formatted xml data.
Upvotes: 0
Views: 2722
Reputation: 29424
Don't set the XML as the innerHTML. Create an inner text node, e.g.
elem.appendChild( document.createTextNode(yourXmlString) );
Google Code Prettify could help
Upvotes: 1