how to change the value of xml present at client side using javascript
Hi
Kindly help me out changing the information in xml file using javascript.
I am totally stucked....
I m doing for saving file :
function doSubmit(){
xmlDoc = loadXMLDoc("abc.xml");
var len = xmlDoc.getElementsByTagName("original").length;
if( (-1 < currentRow) && (currentRow < len) ) {
alert(document.controlForm.notes.value);
xmlDoc.getElementsByTagName("notes")[currentRow].childNodes[0].nodeValue = document.controlForm.notes.value;
xmlDoc.save("abc.xml");
}
}
var currentRow = -1;
var xhttp = null;
function loadXMLDoc(dname) {
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//alert(xhttp);
xhttp.open("GET", 'abc.xml', false);
xhttp.send(null);
return xhttp.responseXML;
}
|