Consequences javascript can have [removed] in the code?

后端 未结 1 2032
情话喂你
情话喂你 2021-01-27 14:25

The question is about this article: https://www.html5rocks.com/en/tutorials/speed/script-loading/

They are saying this:



        
1条回答
  •  滥情空心
    2021-01-27 15:10

    I think the quote is correct, if not fully complete. Rendering is indeed blocked, but not directly; rendering depends upon the parser, which is directly blocked until the javascript finishes execution. So you are correct that the real issue is the parser being blocked, although the render is also being blocked (indirectly) due to its dependence on the parser.

    In this code snippet, you can see that the first div is parsed, but not rendered; the second div is never parsed in the snippet because it is waiting for the javascript to finish.

    SOME HTML
    SOME MORE HTML

    0 讨论(0)
提交回复
热议问题