简体   繁体   English

在所有脚本都准备就绪之前,Safari不会渲染,不像Chrome或Firefox

[英]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. 我试过,但即使deferasync也不是解决方案。

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.

相关问题 倒数计时器无法在Chrome / Safari上正常呈现,但在Firefox上正常 - Countdown timer doesn't render right on Chrome/Safari, but OK on Firefox VueJS 无法在 MacOS(Safari 和 Chrome)上呈现 - VueJS doesn't render on MacOS (Safari and Chrome) Highcharts不会扩展 <div> 在Chrome / Safari中适当的高度,在Firefox中根本不显示 - Highcharts doesn't expand <div> to proper height in Chrome/Safari and doesn't display at all in Firefox 在调整窗口大小之前,在准备好时应用CSS无法正确呈现 - Applying CSS on ready doesn't render properly until window is resized 我的脚本无法在Mozilla Firefox上运行,但可以在Chrome上运行 - My scripts doesn't work on Mozilla Firefox but does on Chrome JavaScript 在 Safari 中不起作用,但在 Firefox 和 Chrome 中起作用 - JavaScript doesn't work in Safari but does in Firefox and Chrome jsPDF在Chrome中不起作用,只适用于Firefox和Safari - jsPDF doesn't work in Chrome, only Firefox & Safari 我的视频实现无法在Firefox和Safari浏览器中使用; 仅镀铬 - My implementation of video doesn't work in firefox and safari; only chrome 在重绘之前,Chrome有时不会呈现Google字体 - Chrome sometimes doesn't render Google font until redraw SVG不在Firefox中渲染字体(适用于IE9和Chrome) - SVG doesn't render fonts in Firefox (works in IE9 and Chrome)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM