function window::onload(){ var xmlStr = ""; xmlStr += ""; xmlStr += " "; var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; xmlDoc.loadXML(xmlStr); var subNodeList = xmlDoc.getElementsByTagName("sub"); var subNode = subNodeList.item(0); var toy = subNode.getElementsByTagName("toy").item(0).firstChild.nodeValue; document.getElementById("divTest").innerHTML = "cnt: " + subNodeList.length + ""; xmlStr += " "; xmlStr += " "; xmlStr += "0
"; xmlStr += "정상 "; xmlStr += "7812172009010 "; xmlStr += "000 "; xmlStr += " "; xmlStr += "컴 "; xmlStr += "1 "; xmlStr += " "; xmlStr += " "; xmlStr += "폰 "; xmlStr += "2 "; xmlStr += " "; xmlStr += " "; xmlStr += "
첫번째 toy: " + toy; }
javascript DOM 접근 예제
2009. 3. 17. 14:02