[英]Embedding external js scripts - reasonable limits?
We have main layout page, and we have some external scripts, that loading after page loaded via ajax. 我们有主布局页面,还有一些外部脚本,这些脚本在通过ajax加载页面之后加载。 Some of them are really slow, cause they are opening socket.io connection.
其中一些确实很慢,因为它们正在打开socket.io连接。 This slow down whole page load.
这会减慢整个页面的加载速度。
I have some questions: 我有一些疑问:
Is it ok, if external widget contains more than 5 scripts in body? 如果外部窗口小部件的主体中包含5个以上的脚本,可以吗? What reasonable limits we should have on count of scripts per service?
我们应该对每个服务的脚本数量有什么合理的限制?
<script src="/path/to.js"></script>
embedded in ajax loaded html - will make sync or async query to server? 嵌入到Ajax加载的html中的
<script src="/path/to.js"></script>
-将对服务器进行同步或异步查询?
How to avoid browser block, during external script load? 在外部脚本加载期间如何避免浏览器阻塞?
How to improve speed loading time, when we have a lot of external scripts? 当我们有很多外部脚本时,如何提高加载速度?
a good read is this: http://www.sitepoint.com/a-detailed-breakdown-of-the-ltscriptgt-tag/ 很好的读法是: http : //www.sitepoint.com/a-detailed-breakdown-of-the-ltscriptgt-tag/
it is very thorough in explaining the history and evolution of the script tag itself, and has some of it's best practices. 它在解释脚本标签本身的历史和演变方面非常详尽,并具有一些最佳实践。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.