티스토리 뷰

카테고리 없음

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>
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함