Why do most of the websites doesn't have a preloader? I am thinking to put a preloader for my website, but I wonder why many website which needs a preloader for their heavy content开发者_StackOverflow but they don't have one ? And I am looking for a good preloader tutorial.
Because most website content are not large enough to warrant a preloader. A website generally loads in less than a second on most connections.
For those AJAX-accelerated websites that load the entire website in the background (all pages, etc.), they usually employ a prioritization system so that the pages being viewed are loaded first, and thus, the above still holds true.
I don't know what you mean by preloader, But for the major frameworks, You should use the public Google repository.
This means users are more likely to have the JS cached already. This will speed up your site.
Also make sure all JS content is minimized, and you have compression turned on in your server.
I assume you are referring to preloading content via JavaScript. This used to be done quite often, and in a few scenarios is appropriate to use. However, due to recent browser benchmarking, it has been found that placing JavaScript at the bottom of the body mostly eliminates the need for preloading. Additionally, as Byron mentioned, you should use the google CDN for resources like jquery.
精彩评论