有没有任何轻量级的JavaScript日期选择器? [英] Is there any lightweight JavaScript date picker?
问题描述
你认为用户将等待600 KB在浏览器中下载?可能需要8到10秒钟。我不认为用户会等待这么长时间。
我想保持我的网站轻量级。有没有任何轻量级的JavaScript日期选择器?
一个选项是使用内容传送网络(CDN),例如 Google Libraries API 来提供像jQuery这样的通用脚本文件。使用CDN的机会是,用户已经将脚本文件缓存在浏览器中,并且不需要再次下载。对于其他静态资源,您可以阅读 YSlow建议,以优化静态资源的加载时间(您可以 minify ,gzip compress和缓存静态资源)。
I am using the jQuery Date picker, but it is too heavy, the minified version of ui.datepicker.min.js is 44 KB. The images of datepicker have their own weight. The jQuery framework is 59 KB. And the total images on the page are around 80 KB. The total HTML of the page is around 70 KB and the CSS file size is around 72 KB. And much more, and all the things add up to 600 KB (0.6 MB).
Do you think the user will wait for 600 KB to be downloaded in the browser? It may take upto 8 - 10 secs. And I don't think that the user will wait for such a long time.
I want to keep my website lightweight. Is there any lightweight JavaScript date picker?
One option is to use a content delivery network (CDN) such as the Google Libraries API to serve common script files like jQuery. Using a CDN chances are that users will already have the script file cached in their browser and they won't need to download it again. As for the other static resources you may read YSlow recommendations for optimizing load times of static resources (you could minify, gzip compress and cache static resources).
这篇关于有没有任何轻量级的JavaScript日期选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!