简体   繁体   English

在加载Head之前呈现HTML页面

[英]Render HTML page before Head loads

I have a <head> tag with a lot of scripts, converted a website from 7 pages into 1 and so now the 1 page is doing the work of 7. There is about a 2 - 30 second load time and I am in no way going to make this optimized for mobile. 我有一个带有很多脚本的<head>标记,将一个网站从7个页面转换为1个,所以现在1个页面正在执行7个工作。加载时间大约为2-30秒,我绝不是使其针对移动设备进行优化。

Writing raw html doesn't seem to show until the page is fully loaded, so writing 'Loading, please wait...' doesn't appear until after the fact. 直到页面完全加载后,似乎才显示原始html,因此直到出现此情况后,才会显示“正在加载,请稍候...”。

How does one display a loading comment before the head tag finishes loading? 在head标签完成加载之前,如何显示加载注释?

Off the bat you have three simple options. 即时,您有三个简单的选择。 You could move scripts out of the head, or you could defer the scripts , or you could async the scripts . 您可以将脚本移出头部,也可以推迟脚本 ,也可以异步执行脚本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM