hi all,
how u doing??!
it’s K
i got this script collect data and search in it from xml file
the xml file is data.xml:
<?xml version="1.0" encoding="utf-8" ?>
<data>
<get>
<name>david</name>
<num>123</num>
<city>London</city>
</get>
<get>
<name>John</name>
<num>549</num>
<city>Kent</city>
</get>
</data>
and in the javascript file name.js:
....
.....
var xml_data = 'data.xml';
....
....
if (data_source < 2)
{
var s = new Array();
if (window.ActiveXObject)
{
var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmldoc.async = false;
xmldoc.onreadystatechange = function()
{
if (xmldoc.readyState == 4) get_xml();
}
}
else if (document.implementation && document.implementation.createDocument)
{
var xmldoc = document.implementation.createDocument("", "", null);
xmldoc.async = false;
xmldoc.onload = get_xml;
}
xmldoc.load(xml_data);
}
is this case the script work very good… but …
But if i want resive data from more than one file
file 1: data1.xml
file 2: data2.xml
file 3: data3.xml
example:
var xml_data = new Array()
xml_data[0] = 'data1.xml';
xml_data[0] = 'data2.xml';
xml_data[0] = 'data3.xml';
how the javascript script code will be ??!
i mean what is the code to load more than xml file ?