I have a website where users can enter some information in tables. By clicking a button, these information should be stored in a XML document and send with AJAX.
I’ve already tried this to create a XML document, but it isn’t working out.
var xmlDoc = '<?xml version="1.0" encoding="iso-8859-1"?>';
xmlDoc.append('<customer></customer>');
How do I create a XML document and append further nodes and set attributes?
You cannot use jQuery
appendmethod on a string, it will throw js error.You can try something like this.
Other way is to create a XML string based on the tabular information available on the page and then use
$.parseXML()method to create XML document.