asp.net 页面加载进度

6/19/2011 8:42:20 AM

<script type="text/javascript">
document.write('<div id="divShowLoading" style="position:absolute; display:none;"><img src="../../images/loading.gif" alt="" />数据正在加载...</div>');  
<!--

    function showProcess() {
        GetMsg();
    }
    var timerId = null;
    function GetMsg() {
        var msg = document.getElementById("divShowLoading");
        msg.style.left = (document.body.clientWidth - 220) / 2;
        msg.style.top = window.screen.height / 3 - 120;
        if (window.document.readyState != null && window.document.readyState != 'complete') {
            msg.style.display = "block";
        }
        else {
            msg.style.display = "none";
            window.clearTimeout(timerId);
            return;
        }
        timerId = window.setTimeout('GetMsg()', 1000);
    }
    showProcess();
//-->
</script>