Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Minify your Javascript and CSS

I've just came across scriptalizer.com which is well worth sharing with all.

This site takes your multiple CSS files or Javascript files and compresses them into just one file.

So your CSS goes from:

view plain print about
1<link rel="stylesheet" href="/style/longstylesheet.css" type="text/css" />
2<link rel="stylesheet" href="/style/anotherlongstylesheet.css" type="text/css" />

to:

view plain print about
1<link rel="stylesheet" href="/style/scriptalizer.css" type="text/css" />

Or your Javascript from:

view plain print about
1<script type="text/javascript" src="/js/jquery/jquery.js"></script>
2<script type="text/javascript" src="/js/jquery/jquery.form.js"></script>
3<script type="text/javascript" src="/js/myOwnScriptFile.js"></script>

to this:

view plain print about
1<script type="text/javascript" src="/js/scriptalizer.js" ></script>

Comments Comments (7) | Print Print | Send Send | 1683 Views

If you like what you see on the website and/or this post has helped you out in some way please consider donating to help keep me in beer vodka. The donations are made through Paypal, which accepts almost any credit card or eCheck.

(Comment Moderation is enabled. Your comment will not appear until approved.)
Thanks for the shout-out Andy. Always cool to hear people find your stuff (and think its good) ;)

Aaron Lynch
And.... it's a ColdFusion site written by our community's own Aaron Lynch http://www.aaronlynch.com :)
I think it's only important to point out that although it's a very good compression, the files become almost unreadable after it, as all the unnecessary spaces and variable names are changed, so the file has the minimum number of characters as possible. You can still edit it, but its difficult to understand, as the code is a bit different normally.
Even Openbluedragon has this now, making use of the Yahoo Compressor, which I think Scriptalizer also uses. Just saw that there was a new CFC on Riaforge, Combine.cfc, which does the same as Scriptalizer, but then serverside. Essentially it does the same as CF_CSS and CF_JS in Openbluedragon. Something for CF 9 maybe?
I too would recommend taking a look at http://combine.riaforge.org. It's a really slick way to have your webserver combine and compress multiple JS/CSS files on the fly when the page is requested.

I've been using this library for a little while and really like it. I've made a few enhancements to the library to fix a few bugs and add a few nice enhancements. If you're interested, my updated library is available at http://github.com/RichardDavies/combine.cfc/tree/m.... (I've submitted my code to the original developer, but those changes haven't all been integrated back into the main library yet.)
Joe Roberts's Gravatar Posted By Joe Roberts @ 3/16/09 4:13 AM
Hi Richard. I have updated the project with fixes for the bugs you identified, thanks again for your input. http://combine.riaforge.org/

I'm looking to make some improvements this week. In addition to Richard's suggestions, I also aim to de-couple the JS and CSS compressors (JSmin and YUI css). I want to make it very easy to switch between different compression tools such as JSMin and the YUiCompressors, or to even write your own compression CFC.
A few years back, because of the lack of technology, search engines bypass sites that use an Ajax dashboard. Search engines were not programmed to detect java scripts and thus SEO bots do not list them in the search results, instead they only show crawl-able static websites.

Java script
http://ajaxdashboard.com/
BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .