When I don't minify, my site works. When I run python slimmer's js minifier, I get "unexpected" errors all over the place.
My scripts are basically just Jquery plugsin...
Look at my scripts:
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/jquery-1.4.4.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/json2.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery-ui-1.8.7.custom/development-bundle/ui/jquery-ui-1.8.7.custom.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery-msdropdown/js/uncompressed.jquery.dd.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery.scrollTo-1.4.2/jquery.scrollTo.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery-masonry/jquery.masonry.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery-jeditable/jquery.jeditable.js"></script>
&l开发者_JAVA百科t;script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery.growfield2.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery.placeholder.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery.color.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/plugins/tipsy/src/javascripts/jquery.tipsy.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/template/alertbar.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/mosaic_media/js/fileuploader.js" type="text/javascript"></script>
Python-slimmer minified them, and now they don't work.
Uncaught SyntaxError: Missing catch or finally after try
json2.js:30Uncaught SyntaxError: Unexpected token .
jquery-ui-1.8.7.custom.js:5Uncaught SyntaxError: Unexpected token .
jquery.scrollTo.js:1Uncaught SyntaxError: Unexpected end of input
jquery.masonry.js:1Uncaught SyntaxError: Unexpected end of input
jquery.jeditable.js:1Uncaught SyntaxError: Unexpected end of input
jquery.growfield2.js:1Uncaught SyntaxError: Unexpected end of input
jquery.placeholder.js:1Uncaught SyntaxError: Unexpected end of input
jquery.color.js:1Uncaught SyntaxError: Unexpected end of input
jquery.fancybox-1.3.4.js:1Uncaught SyntaxError: Unexpected end of input
jquery.tipsy.js:1Uncaught SyntaxError: Unexpected end of input
alertbar.js:1Uncaught ReferenceError: $ is not defined
fileuploader.js:2Uncaught SyntaxError: Unexpected token .
detail.js:1Uncaught SyntaxError: Unexpected identifier
I recommend you take a look at webassets: https://github.com/miracle2k/webassets
It includes a YUI compressor filter so you can generate minified files.
精彩评论