Yes. In order to minify, depending upon the method used, the script code must increasingly adhere to standards, otherwise, conventions that allow for omissions at the end of lines will no longer be understood, and/or comments (if not stripped) can become problematical. For example, one can go:
Code:
var bob = "you're uncle"
var ted = "alice"
But without proper strict terminus, that cannot become:
Code:
var bob = "you're uncle"var ted = "alice"
But if originally it was strict:
Code:
var bob = "you're uncle";
var ted = "alice";
It then can become:
Code:
var bob = "you're uncle";var ted = "alice";
There are so many conventions like these that are loosely OK with line breaks, that will break a script if those line breaks are removed without adding strict notations of one sort or another that - well I think you get the idea.
Basically strict javascript code is much more easily/successfully compressed than more loose/haphazardly written code.
jslint is a good if sometimes frustrating tool to use to ready your javascript code for successful compression:
http://www.jslint.com
Even so (making the code compliant with such a tool), some certain techniques can still cause problems once code is compressed. For those, individual investigation is required.
That said, javascript is ordinarily not all that big. You will have far greater savings in most cases via compressing the images a page uses.
Bookmarks