因此,在我的网页上,我确实需要一些文字,一旦你访问该网站,实际上用户在整届会议上可能根本不需要这些文字。
此外,根据:http://code.google.com/speed/page-speed/docs/ Payload.html#DeferLoadingJS”http://code.google.com/speed/page-speed/docs/ Payload.html#DeferLoadingJS 它不是良好做法。
例如,在我dom熟的时候,我有:
$(function() {
// most of the code of which is not needed
});
If I dont place the code inside the Dom ready, its not executable at most of the times. So I thought of doing seperate functions for each snippet.
单价:
function snippet1() {
// Code here
}
当时,当我需要打刀时,当需要时,我装上了浮标。 (永远不会是 mo,取决于我需要装载的东西)。
例如:
$( #button1 ).click(function() {
snippet1();
});
因此,我的问题是: 这种加装功能的方式是否使你缩短了页数时间,或者有更好的方式? 我在任何地方都想到这一点。
请注意,我知道超负荷工作,但这不是我在此的选择,因为我可以把所有职能合并为一个单列的档案,这样一页的负荷时间将低于每当一把小.碎档案时的负荷。