Code:
<html>
<head>
<script type='text/javascript'>
var xml_modules;
xml_modules="<modules><module><code></code><tbl></tbl></module></modules>";
var xml_Doc_modules=loadString(xml_modules);
function loadString(txt)
{
var xml_Doc;
try{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM") ;
xml_Doc.async="false";
xml_Doc.loadXML(txt);
return xml_Doc;
}
catch(e)
{
try{
parser=new DOMParser();
xml_Doc=parser.parseFromString(txt,"text/xml");
xml_Doc.encoding='UTF-8';alert('sad');
return xml_Doc;
}
catch(e){
alert(e.message);
}
}
return (null);
}
function testxml(){
root=xml_Doc_modules.childNodes[0];
code_text1=document.createTextNode('codel');
code_text=document.createTextNode('tbl');
root.childNodes[0].childNodes[1].appendChild(code_text);alert(root.childNodes[0].childNodes[0].nodeValue);
root.childNodes[0].childNodes[0].appendChild(code_text);alert(root.childNodes[0].childNodes[1].nodeValue);
}
</script>
<body>
<button onclick='testxml()'>Preess me</button>
</body>
</html>
I am getting a nulll value alll the time ....
Hw cn i solve this problem ???
Thanks in adv
With regards
Phpuser123
Comment