달력

42024  이전 다음

  • 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
질문,광고 등록 절대금지! 질문은 Q&A로
글쓴이:슈퍼개발 완전 로딩후 페이지 보여주기 (onreadystatechange)조회수:926

http://www.mytechnic.com
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/ifaces/document2/get_readystate.asp

최근에 완전로딩후에 페이지를 보는 방법에 대한 팁이 자주 보고,  아래에 어떤 분이 readystate에 대한 언급을 해 주셔서, 한번 만들어 보았습니다. 내용은 아주 간단합니다.

lib.php ------------------------------------
<?php
function loadding()
{
    echo ("
        <div ID='waitingDiv' style='position:absolute; overflow:hidden; border:0px; z-index:1;'>
        <table width='880' height='500' border='0' cellpadding='0' cellspacing='0'>
        <tr>
            <td align='center'>
                <table border='0' cellpadding='0' cellspacing='0'>
                <tr>
                    <td>
                        <table width='500' border='0' cellpadding='10' cellspacing='1' bgcolor='#D0D0D0'>
                        <tr bgcolor='#F5F5F5'>
                            <td align='center'>
                                <table width='400' border='0' cellpadding='0' cellspacing='0'>
                                <tr>
                                    <td><font style='font-size:9pt;' color='#FF0000'>처리중입니다.</font></td>
                                </tr>
                                <tr>
                                    <td><font style='font-size:9pt;' color='#6600FF'>잠시 기다려 주세요.</font></td>
                                </tr>
                                <tr height='50'>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td><img src='http://www.mytechnic.com/_logo/logo.gif' width='126' height='39' border='0'></td>
                                </tr>
                                </table>                        
                            </td>
                        </tr>
                        </table>
                    </td>
                </tr>
                </table>
            </td>
        </tr>
        </table>
        </div>

        <SCRIPT LANGUAGE='JavaScript'>
        <!--
        document.onreadystatechange = fnStartInit;
        function fnStartInit()
        {
           if (document.readyState=='complete')
           {
                if (document.all['waitingDiv']) {
                    document.all['waitingDiv'].style.visibility = 'hidden';
                }
           }
        }
        //-->
        </SCRIPT>");
        flush();
}
?>

demo.php ------------------------------------
<?php
include("lib.php");
loadding();

// PHP 코딩 시작하세요.



?>

Posted by tornado
|