[英]Safari doesn't render until all scripts are ready not like Chrome or Firefox
http://stevesouders.com/tests/ix-js.php http://stevesouders.com/tests/ix-js.php
This page has 8000ms script before </body>
. 此页面在</body>
之前有8000毫秒的脚本。 As I know, browsers render progressively, so it doesn't affect the visual result. 据我所知,浏览器会逐步渲染,因此不会影响视觉效果。 Chrome and Firefox perform as I expected. Chrome和Firefox的效果与我预期的相同。 But, Safari - both in macOS and iOS - doesn't. 但是,Safari(无论是在macOS还是iOS)都没有。
It WAITS until the script is downloaded and parsed. 它等待直到下载并解析脚本。 Very weird. 很奇怪。
http://stevesouders.com/hpws/move-scripts.php http://stevesouders.com/hpws/move-scripts.php
Here's another example. 这是另一个例子。 For this, Safari renders normally, as I expected. 为此,Safari正常呈现,正如我预期的那样。
Please explain this confusing behavior. 请解释这个令人困惑的行为。 I tried but even defer
or async
are not the solution. 我试过,但即使defer
或async
也不是解决方案。
It seems that the size of the content matters. 看来内容的大小很重要。 The content of the first link is too small to render on Safari. 第一个链接的内容太小,无法在Safari上呈现。
Please refer this thread: https://stackoverflow.com/a/16909228/2480917 请参考以下主题: https : //stackoverflow.com/a/16909228/2480917
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.