Deny inconsistency (and late) page rendering in safari

Situation

I am trying to create a responsive application. First, the index page is loaded containing the basic animation for loading CSS and HTML, and then external scripts and CSS in blocking order immediately before </body>, while the last script removes the bootloader animation and displays the page.

The purpose of this is to load a very small page (total 2KB) containing the downloadable animation, and then load the 8MBscripts, style sheets and images, creating a more seamless user interface.

<html>
  <head>
    ...
    [loader css]
  </head>
  <body>
    <div id="loader">...</div>

    <script src="..."></script>
    <script src="..."></script>
    <link href="..." type="text/css" rel="stylesheet" />

    <script> [remove #loader] </script>
  </body>
</html>

Problem

Chrome, ( ), . , :

Safari -, , .

; ( body) , , HTML-.


- , :

. !

+4
1

, , JavaScript , . defer , , , - .

defer script defer script. defer , . ( async DOMContentLoaded .)

React.js , , DOMContentReady.

+1

Source: https://habr.com/ru/post/1649722/


All Articles