Closure Compile From URL

by Chris Watson

HTML

Awaiting response...

JavaScript

function showResult(result) {
    window.location.replace('data:text/plain,' + result);
}

$.post('http://closure-compiler.appspot.com/compile', {
    'code_url': document.location.hash.substring(1),
    'compilation_level': 'SIMPLE_OPTIMIZATIONS',
    'output_format': 'text',
    'output_info': 'compiled_code'
}, function () {}, 'text')
.done(showResult)
.fail(function (jqXhr, textStatus, err) {
    showResult(err);
});