AJAX的HTML页面代码

<html>
<head>
    <title>Arts</title>
    <script type="text/javascript">
        function creatRequest() {
            if (window.ActiveXObject) {
                return new ActiveXObject("Microsoft.XMLHTTP");
            } else if (window.XMLHttpRequest) {
                return new XMLHttpRequest;
            }
        }
        var request;
        function checkOpen() {
            var url = "ClassisServer?username=jimee";
            request = creatRequest();
            request.Open("GET", url, true);
            request.onreadystatechange = getResult;
            request.send(null);
        }
        function getResult() {
            if (request.readyState == 4 && request.status == 200) {
                response = request.responseText;
                document.getElementById("result").innerHTML = response;
            }
        }
    </script>
</head>
<body>
<div id="result"></div>
<br>
<a href="javascript:checkOpen()">Open</a>
<br>
</body>
</html>

你可能感兴趣的:(html,Ajax,Microsoft)