if (window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; if (xmlDoc.load(xmlFile)) { xmlDoc.load(xmlFile); eval(funcName()); }else{ alert('無法載入檔案'); } }elseif (document.implementation && document.implementation.createDocument) { xmlDoc = document.implementation.createDocument("","",null); if (xmlDoc.load(xmlFile)) { xmlDoc.load(xmlFile); }else{ alert('無法載入檔案'); } xmlDoc.onload=funcName; } else { alert('對不起,你的瀏覽器不支援此程式'); } }
// Func functionloadListIconFunc() { var iconData = xmlDoc.getElementsByTagName("iconData")[0]; var info = iconData.getElementsByTagName("info"); var icon = iconData.getElementsByTagName("icon");
total = info.item(0).attributes.item(0).value; // Icon Total