js操作XML文件的例子


 

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 

xmlDoc.async 
= false;

xmlDoc.load(
"Tipsxml/tips.xml");

var firstinfo=xmlDoc.documentElement.selectSingleNode("Class[@name='文章管理']").childNodes;

for(var j=0;j<firstinfo.length;j++)                                    

{

var newOption =window.document.createElement("OPTION");

if(firstinfo[j].getAttribute("name")!="")

newOption.text
=firstinfo[j].getAttribute("name");

else

newOption.text
="全部子类";

newOption.value
=firstinfo[j].getAttribute("code");

drp2.options.add(newOption);

}

相关文章:

  • 2021-11-05
  • 2021-07-16
  • 2021-07-27
  • 2021-06-29
  • 2022-12-23
  • 2021-09-11
  • 2021-08-23
  • 2021-09-29
猜你喜欢
  • 2021-11-16
  • 2021-09-07
  • 2022-12-23
  • 2021-07-06
相关资源
相似解决方案