views:

281

answers:

3

I am using JQuery Date picker, but it is too much heavy, the minified version of ui.datepicker.min.js is of 44 KB. the images of datepicker have their own weigh. the jquery framework is of 59 KB. and total images on page are of around 80 KB the total html of page is around 70 KB and the css file size is around 72 KB. and much more, and all the things go upto 600 KB. which is 0.6 MB.

do you think user will wait for 600 KB to be downloaded in the browser? it may take upto 8 - 10 secs. and I dont think that user will wait for such long time.

I want to keep my website light weight. is there any light weight javascript date picker.

A: 

One option is to use content delivery network such as google 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).

Darin Dimitrov
I am already using microsoft cdn to serve jquery (http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx) framework.and i have also implemented most of the rules of YSlow.but you know, Interactive website always hurts performance of website.I am trying to optimize it as much as possible. there is only one field on the page where i have to show calender. and it adds 44 KB for Jquery datepicker. :(
Zain Shaikh
jqueryui containing datepicker is already hosted on google CDN. And by the way it is not 44KB, it is 12KB when gzipped.
Darin Dimitrov
A: 

I've seen this one in production -- seems to be a bit lighter in weight. http://calendar.moonscript.com/dateinput.cfm I can't fully vouch for the feature set etc.

LesterDove
+1  A: 

I faced the same issue with official jquery example (see my comment above). I isolated the problem to css themes and started stripping away junk. Before I finished I found a guy had done exactly what I needed: http://keith-wood.name/datepickBasics.html It required DatePicker.js and a single css file. All told 2 http requests and 40k in addition to the basic jquery file everybody should have cached like Darin says above.

Glenn