Miguel, >I want to download and start using JQuery. > >Which one should I download? >And why the file sizes do no match? > >For example, for >45.3Kb - http://code.google.com/p/jqueryjs/downloads/detail?name=jquery- >1.2.1.min.js >14Kb - http://docs.jquery.com/Release:jQuery_1.2.1
The reason for the size listed for the min'ed version (14Kb) is to indicate the total size of the file if it's served via GZIP compression from the webserver. If your server is configured (or can be configured) to use GZIP compression to serve .js pages, your best bet is to use the min'ed version as it's the smallest deliver size and won't rely on any "unpacking" inside the browser. A quick summary of JS library file size types: * Normal full source - This is the code with all comments and whitespace intact. * Min'ed source code - This is the source code with all unnecessary text removed (whitespace, comments, etc.) * Packed source code - This is the source code encoded to "compress" the output. This often does variable manipulation and other things to reduce the file size. The downside to "packing" JS is that it can corrupt the code (although jQuery is test against the packed code--so that won't be an issue) and that it requires the browser to "unpack" the code--which depending on the library can add a few 100ms of overhead. -Dan