Javascript – How to apply Google Closure to the entire web page

compressiongoogle-closure-compilerjavascript

Google has the very nice JavaScript compressor called "Closure"

http://closure-compiler.appspot.com/home

But it's a pain to use for inline JavaScript within an HTML file.

Question: Does an online tool exist where I simply give the input "uncompress.html" and it spits out the compressed version of that HTML with all inline JavaScript compressed as well?

Best Answer

Minifiers,obfuscators and compressors have been designed to solve the issue of downloading external elements when loading a page. They were never meant to be used for inline JavaScript or CSS since lots of that is normally kept outside of the page in a separate file.

Since you should be gzipping as much as you can, for browsers that can handle gzip, it shouldn't in reality matter that your inline css/javascript isn't minified on the page.