Javascript.Minnify()


These days developers are using various Ajax toolkits to create more user friendly and responsive web sites. No matter the which toolkit you use, be it Microsoft AJAX, AJAX Control Tool kit, YUI, scriptaculous, Google web toolkit, or JQuery, etc. what you cannot live without is Javascript. So more you make your web page Ajaxified, you end up writing more Javascript. This can lead to larger page size that needs to get downloaded to users web broweser when rendered.
Leading javascript tool libraries provide you with a small release file and a little larger debug file. You can do this for your web pages too…

It is a good practise in terms of managing your code to put all the javascript code into a *.js file and referencing the file from your web page. There are tools available now that will enable us to create a smaller js file by removing all the whitepsaces and making other space saving optimizations.

Here is couple of such tools I have used:

1) JSMIN – This is a very nice program to reduce the javascript file size developed by Douglas Crockford. You can download JSMIN from here. I like JSMIN better than any other similar programs of its simplicity and more over it fits my need.

JSMIN can be obtained as a DOS executable, or if you prefer you download code in C, C#, Java, Javascript and Perl. Click on
this link to get to all these. (Personaly I downloaded C# program and made my own executable). Note that JSMIN does not
obfuscate your code.

2) Packer – is a Javascript compressor and obfuscator developed by Dean Edwards. Various versions of packer can be downloaded
from here.

Hope next release of your web pages will be smaller in size..
Minnify and save band width 🙂

Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s