我将Xml文档编为javascript,然后想将所有数据加起来。 但它没有这样做,而是没有确定。
GDownloadUrl("./include/dataemp2.xml", function(data) {
var xml = GXml.parse(data);
markers = xml.documentElement.getElementsByTagName("marker");
for(var t=0;t<18;t++)
{
var temp= markers[index].getAttribute("address");
html = html + temp;
}
});
it is returning as undefined because temp is not concatenating in "html"; whereas when i do this like html = html +markers[index].getAttribute("address"); it is giving me expected output;