min10

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

原文链接:http://hi.baidu.com/freesunshine/blog/item/a8f62ff30f250dcc0b46e094.html

<script langage=javaScript>

var xmlHttp;
    function createXmlHttpRequest()
    {
        if(window.XMLHttpRequest)
        {
            xmlHttp=new XMLHttpRequest();
       
            if(xmlHttp.overrideMimeType)
                {
                    xmlHttp.overrideMimeType("text/xml");
                }
        }
        else if(window.ActiveXObject)
        {
            try
            {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");  
            }
            catch(e)
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  
            }
        }
        if(!xmlHttp)
        {
            window.alert("你的浏览器不支持创建XMLhttpRequest对象");
        }
        return xmlHttp;
    }
    function ValidateCode(jobNo,lock)
    {
        createXmlHttpRequest();
        var url="test/aaaa.aspx?jobNo="+jobNo+"&Lock="+lock;
        xmlHttp.open("GET",url,true);
        xmlHttp.onreadystatechange=ValidateResult;
        xmlHttp.send(null);
    }
    function ValidateResult()
    {
        if(xmlHttp.readyState==4)
        {
            if(xmlHttp.status==200)
            {
               window.alert(xmlHttp.responseText);
               window.location.reload();
            }
        }
    }

</SCRIPT>

 

aaaa.aspx

Response.Write("OK!");

Response.Flush();//发送响应
Response.End();

posted on 2009-03-18 14:56  min10  阅读(281)  评论(0编辑  收藏  举报