2
<head>
    <script type="text/javascript">

        document.onreadystatechange = WaitForComplete;

        function WaitForComplete () {
            console.log ("The state of the document: " + document.readyState);
        }

        function OnLoad () {
            console.log ("The document has been loaded.");
        }
    </script>
</head>
<body onload="OnLoad ()">
</body>

firefox->コンソールでは、次のように表示されます。

The state of the document: interactive
The state of the document: complete
The document has been loaded.

質問:

なぜFirefoxでスクリプトを実行するたびに、とだけが表示interactiveされるのcompleteですか? 他の州はどうですか: uninitialized, loading...

4

1 に答える 1