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

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

问题描述

我正在使用 jQuery 日期选择器,但它太重了,ui.datepicker.min.js 的缩小版本是 44 KB.datepicker 的图像有自己的权重.jQuery 框架为 59 KB.页面上的总图像大约为 80 KB.页面的总 HTML 大约为 70 KB,CSS 文件大小大约为 72 KB.还有更多,所有内容加起来为 600 KB (0.6 MB).

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).

您认为用户会在浏览器中等待 600 KB 下载吗?最多可能需要 8 - 10 秒.而且我不认为用户会等待这么长时间.

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.

我想让我的网站保持轻量级.有没有轻量级的 JavaScript 日期选择器?

I want to keep my website lightweight. Is there any lightweight JavaScript date picker?

推荐答案

一种选择是使用 内容交付网络 (CDN),例如Google Libraries API 来提供服务常见的脚本文件,如 jQuery.使用 CDN 的可能性是用户已经将脚本文件缓存在他们的浏览器中,他们不需要再次下载它.至于其他静态资源,您可以阅读YSlow 建议以优化静态资源的加载时间(您可以缩小、gzip 压缩和缓存静态资源).

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天全站免登陆