티스토리 뷰
< script language="JavaScript">
// PostXml
function PostXml() {
var req = new ActiveXObject("Microsoft.XMLHTTP");
req.Open("POST", "/xml/xmlhttp.jsp", false);
req.Send(str);
var dom = new ActiveXObject("Microsoft.XMLDOM");
dom.async = false;
dom.load(req.responseBody);
var root = dom.documentElement;
var node, value, s;
for (var i = 0; i < root.childNodes.length; i++) {
if (i == 0) {
node = root.firstChild;
s = "";
} else {
node = node.nextSibling;
}
value = node.firstChild;
s = s + node.nodeName +" : "+ value.nodeValue +"\n";
}
alert(s);
}
< /script>
댓글