create and modify xml file using javascript (want to save xml file on client side)
- by user201478
Hi ,
How to save xml file on client side using javascript...?
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
}
else // Internet Explorer 5/6
{
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET", "User.xml", false);
xhttp.send("");
xmlDoc = xhttp.responseXML;
xmlDoc.getElementsByTagName("Username")[0].childNodes[0].nodeValue = 'asdasf';
xmlDoc.getElementsByTagName("password")[0].childNodes[0].nodeValue = 'asdAS';
xmlDoc.getElementsByTagName("UserId")[0].childNodes[0].nodeValue = '12';
xmlDoc.save("User.xml");
this is not working.. showing error as save is not a function.
Thanks
Suneetha.