javascript - html page loading order problem
过去多啦不再A梦
过去多啦不再A梦 2017-05-19 10:45:14
0
2
419
<body>
    <button id="btn1">btn1</button>
    <button id="btn2">btn2</button>
    <p>111111111111111111111111</p>
    <p>222222222222222222222222</p>
    <script>
        var a = 0;
        for(var i=0;i<1000000000;i++){
            a++;
        }
       alert('runs1');
    </script>
    <p>3333333333333333333333333</p>
</body>
<script src="1.js"></script> //1.js 中alert(2);


I would like to ask, the rendering of the page needs to wait until the content before the body is parsed, and then the page will be automatically rendered.
Or do I need to wait until 1.js parsing is completed before rendering the page?

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
巴扎黑

Look at the browser rendering of this article

淡淡烟草味

The rendering of the page is top-down, and the page rendering is higher than your 1.js

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template