javascript xml saving problem

Posted by Guru on Stack Overflow See other posts from Stack Overflow or by Guru
Published on 2010-04-14T09:26:24Z Indexed on 2010/04/14 9:33 UTC
Read the original article Hit count: 165

Filed under:
|

hi there,

I want to modify some data on XML file residing on server side by using javascript.

I'm using following code

var xh; if(window.XMLHttpRequest) { xh=new XMLHttpRequest(); } else { xh=new ActiveXObject("Microsoft.XMLHTTP"); } xh.open("get","books.xml",false); xh.send(""); var xdoc=xh.responseXML; var x=xdoc.getElementsByTagName("title"); x[0].getAttributeNode("lang").nodeValue="zh"; xh.save("books.xml");

but its not working

Thanks in advance, Guru

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about Xml