티스토리 뷰

카테고리 없음

JS : Microsoft.XMLDOM

nalbam 2004. 1. 19. 20:28
< 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>
TAG
,
댓글
댓글쓰기 폼