Put Scripts at the Bottom .
来源:互联网 发布:加工中心编程格式要领 编辑:程序博客网 时间:2024/06/08 05:09
Best Practices for Speeding Up Your Web Site
The problem caused by scripts is that they block parallel downloads. The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. While a script is downloading, however, the browser won't start any other downloads, even on different hostnames.
In some situations it's not easy to move scripts to the bottom. If, for example, the script uses document.write to insert part of the page's content, it can't be moved lower in the page. There might also be scoping issues. In many cases, there are ways to workaround these situations.
An alternative suggestion that often comes up is to use deferred scripts. The DEFER attribute indicates that the script does not contain document.write, and is a clue to browsers that they can continue rendering. Unfortunately, Firefox doesn't support the DEFER attribute. In Internet Explorer, the script may be deferred, but not as much as desired. If a script can be deferred, it can also be moved to the bottom of the page. That will make your web pages load faster.
The problem caused by scripts is that they block parallel downloads. The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. While a script is downloading, however, the browser won't start any other downloads, even on different hostnames.
In some situations it's not easy to move scripts to the bottom. If, for example, the script uses document.write to insert part of the page's content, it can't be moved lower in the page. There might also be scoping issues. In many cases, there are ways to workaround these situations.
An alternative suggestion that often comes up is to use deferred scripts. The DEFER attribute indicates that the script does not contain document.write, and is a clue to browsers that they can continue rendering. Unfortunately, Firefox doesn't support the DEFER attribute. In Internet Explorer, the script may be deferred, but not as much as desired. If a script can be deferred, it can also be moved to the bottom of the page. That will make your web pages load faster.
- Put Scripts at the Bottom
- Put Scripts at the Bottom .
- Android: Tabs at the bottom with FragmentTabHost
- Keep your footer show at the bottom of the page
- Customize UINavigationBar and remove drop shadow at the bottom of UINavigationBar
- 构建高性能网站的14条法则:Put Stylesheets at the Top
- Why do you need to put #!/bin/bash at the beginning of a script file?
- Kaldi-Running the example scripts
- PKU2553 the bottom of the graph
- Where to put the const?
- bottom
- ui page control and scrollview with indicator at bottom
- VI编辑器 Search it Bottom, Continuing at Top
- POJ 2553 The Bottom of A Graph
- poj 2553 The Bottom of a Graph
- poj2553 The Bottom of a Graph
- Computer Science from the Bottom Up
- poj 2553 The Bottom of a Graph
- jquery技巧总结(转)
- sqlite数据库中的sql语句大全
- My Annotation for HTTP Proxy server: PythonProxy
- Asp.Net MVC 3.0【MVC实战项目の一】
- 云坤实创
- Put Scripts at the Bottom .
- 深刻理解servlet
- FAFU1073 队长的情书
- Minify JavaScript and CSS .
- 文本框输入字母检索汉字
- Asp.Net MVC 3.0【MVC实战项目の二】
- JDBC连接各种数据库方法
- ping
- NSUserDefaults简介及使用