티스토리 뷰

카테고리 없음

JS : Microsoft.XMLHTTP

nalbam 2004. 1. 19. 18:22
< script language="JavaScript">
    // PostXml
    function PostXml() {
        var req = new ActiveXObject("Microsoft.XMLHTTP");
 
        var str = "";
        str = str +" 0000000";
 
        req.Open("POST", "/xml/xmlhttp.asp", false);
        req.Send(str);
 
        var str = BinDecode(req.responseBody);
        document.all.vHtml.innerHTML = str;
    }
< /script>
 
< script language="VBScript">
    '// BinDecode : 바이너리 -> 아스키 변환
    function BinDecode(byval binData)
        dim i, byteChr, str
 
        for i = 1 to LenB(binData)
            byteChr = AscB(MidB(binData,i,2))
            if byteChr > 127 then
                i = i + 1
                str = str & Chr("&H" & Hex(byteChr) & Hex(AscB(MidB(binData,i,2))))
            else
                str = str & Chr(byteChr)
            end if
        next
 
        BinDecode = str
    end function
< /script>
 
< body id="vHtml" onload="PostXml()">< /body>
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
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
글 보관함