javascript|services|web|xml| Access
The key code is as follows:
var xmlData = new ActiveXObject ("Msxml.domdocument"); Create a MSXML object
Xmldata.async = false//synchronous fetch data
Xmldata.load ("Web Service URL"); Passing parameters by get way, getting XML objects
Get XML object: Xmldata.xml
Get String:xmlData.text
XML data as shown below:
<diffgr:diffgram xmlns:msdata= "Urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr= "urn:schemas-microsoft-com: Xml-diffgram-v1 ">
< information xmlns= "" >
<gg_test diffgr:id= "Gg_test1" msdata:roworder= "0" >
<ID>5</ID>
<XingMing>aaa</XingMing>
<XingBie> male </XingBie>
<MinZu> Han </MinZu>
</GG_test>
<gg_test diffgr:id= "Gg_test1" msdata:roworder= "1" >
<ID>6</ID>
<XingMing>bbb</XingMing>
<XingBie> male </XingBie>
<MinZu> Han </MinZu>
</GG_test>
</Information >
</diffgr:diffgram>
To access a field that is xingming BBB, use the following JavaScript statement
XmlData.xml.getElementsByTagName ("Gg_test"). Item (1). ChildNodes (1). Text
The idea is to find the Gg_test table, find the record with index 1, and find the contents of the field indexed by 1.