有没有任何轻量级的JavaScript日期选择器? [英] Is there any lightweight JavaScript date picker?

查看:90
本文介绍了有没有任何轻量级的JavaScript日期选择器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery Date选择器,但是它太重了,ui.datepicker.min.js的最小化版本是44 KB。 datepicker的图像有自己的重量。 jQuery框架是59 KB。而且页面上的总图像大约在80 KB左右。页面的总HTML约为70 KB,CSS文件大小约为72 KB。还有更多的东西,所有的东西加起来高达600 KB(0.6 MB)。



你认为用户将等待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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆