They said : (http://api.jquery.com/ready/)
$(document).ready()
Specify a function to execute when the DOM is fully loaded.
I was loaded several url via iframs and looking for the ready event.But my function not work correctly.I want make a overlay while page loading and after loading finished remove the overlay.
Code :
<!DOCTYPE html>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style>
            #overlay{
                background-color: rgb(0, 0, 0);
                border: medium none;
                cursor: wait;
                height: 100%;
                left: 0;
                margin: 0;
                opacity: 0.6;
                padding: 0;
                position: fixed;
                top: 0;
                width: 100%;
                z-index: 1000;
            }
        </style>        
    </head>
    <body>
        <div id="overlay"></div>
        <div>TODO write content</div>
        <iframe src="http://w3school.com"></iframe>
        <iframe src="http://w3school.com"></iframe>
        <iframe src="http://w3school.com"></iframe>
        <iframe src="http://w3school.com"></iframe>
        <iframe src="http://w3school.com"></iframe>
        <iframe src="http://w3school.com"></iframe>
        <iframe src="http://w3school.com"></iframe>        
        <script src="js/jquery.js" type="text/javascript"></script>
        <script>
            var time;
            time = new Date().getTime();
            console.log(time);
            $(document).ready(function () {
                $("#overlay").css({visibility: "hidden"});
                console.log("fired");
                console.log(time - new Date().getTime());
            });
        </script>
    </body>
</html>
Updated:
Even we remove the iframs and added delay loop with php.Then  loaded that page with jquery and the problem is still same.
for ($int = 0; $int < 100000; $int ++) {
    for ($int = 0; $int < 100000; $int ++) {
        for ($int = 0; $int < 100000; $int ++) {
            echo '<pre>'.$int.'</pre>';
        }
    }
}
 
     
    