views:

479

answers:

5

JQuery has two versions for download, one is Production (19KB, Minified and Gzipped), and the other is Development (120KB, Uncompressed Code).

Now the compact 19kb version, if you download it, you will see is still a javascript executable code. How did they compactify it? And how can I 'minify' my codes like that too?

+5  A: 

You could use one of the many available javascript minifiers.

Darin Dimitrov
+1  A: 

http://jscompress.com/

jldupont
Out of the two options the packer seems to work quite well! Thanks
KalEl
A: 

Google just made available a javascript compiler that can minify your code, elimiated dead code branches and more optimizations.

google javascript compiler

Regards
K

Khb
+5  A: 

There’s a nice comparison of JavaScript compressors you should take a look at.

Gumbo
Thanks. When I click the view button, it shows something like my original code (for any of the compressors). Is it decoding and then showing it? Otherwise is there also any way I can see the compressed code too?
KalEl
@KalEl: Click on *View* in the *Result* column to see the output.
Gumbo
A: 

There is also free Minifier from Microsoft on codeplex. Microsoft Ajax Minifier 1.1 : http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35893

It's easy to work with and does a good job.

Gal

Gal Ratner