javascriptoptimizationjscompress

JavaScript stops working when I compress my script


I want to compress my 2000+ lines of javascript and I have tested both http://dean.edwards.name/packer/ and http://closure-compiler.appspot.com/home.

But in both cases, the compressed script gives me errors. An example of an error is jQuery(document).Da is not a function.

Why isn't my script working after optimization? And what can I do to optimize / compress my script?


Solution

  • You could try an online YUI Compressor. This is the first result on google: http://www.refresh-sf.com/yui/