Now there have been many of their own characteristics:
- Jsmin
- Javascript Compressor
- Packer
- Closure Compiler
- YUI Compressor
- Pretty Diff
- JavaScript Optimizer
- Pack:tag
- Minify
- Lightweight
- Cssmin
- jsmin-php
- Minime
- Shrinksafe
- Granule
- Jawr
- Combineandminify
- Crunchme
Some too simple, based on a mainstream idea of imitation (but not beyond the original version of the update) or too many bugs I do not list. For example, a certain number of implementations of PHP, failure is often more than success. (Xee: Sometimes you will find the compression code, the program is not working properly, compared to compress this thing can not be perfect!) But we have to use ~ ~)
----------------------------------------------------------------------------------------?? --------------------------------------------------------------------------------
The JavaScript packer developed by Dean Edwards is the most Packer in jquery-related projects. Through this tool, the size of the JS file can be reduced to at least half the original, that is, compression ratio of more than 50%, and can prevent the JS code is copied, it is double benefit.
(Xee: But note that it can compress errors!) As I said, no compression tool can be perfect, use caution, as I know: Closure compiler The requirements of grammar is more stringent, will lead to some hack skills can not be used. One article mentions: jquery is Google's open-source JS compression tool, Google Closure compiler and Yui compressor is the best way to JS compression. Dean Edwards ' Packer is not recommended!!)
Let's start by introducing what JavaScript Packer is confusing.
Packer is now 3.0. It is a web tool that can be compressed online. It's very simple to use:
- Go to website
- Paste the code you want to compress
- Execute pack
It also has several options: Base62 encode and shrink variables. If these two options are not selected, just remove the extra spaces, line breaks, comments, and so on. If you choose Base62 encode is basically unreadable. If you choose Shrink variables you can compress the variable, specifically how it is done I'm not sure, but the volume does get smaller. However, when I compress the jquery.jform.js, it is strange to find that the result of the Post method that was supposed to be Ajax was turned into a get mode in the test. If you change to an uncompressed version, there is no problem. So positioning is the problem of this packer. So I did not select Base62 encode, but only selected shrink variables, found in the $.ajax parameters, the original is the type of the given to the TYPF, when I selected Base62 encode, but did not select shrink After variables, everything is fine.
So my first advice is: When you run out of error, remove shrink variables and try it.
In addition, my second suggestion is that there must be a semicolon (';') behind each function, and there must be a semicolon after each statement if it is not enclosed in curly braces. Otherwise it would be very troublesome to say a few semicolons at run time.
Here's how to make it easy to complete the semicolon. http://javascriptcompressor.com/forums/p/19/55.aspx#55 The recommended approach here is to paste the code into HTTP.//in advance of compression www.jslint.com/ To do a check, find out all the missing semicolon, manually fill up.
Now many of the JS code in the Openbookplatform I have compressed, and even put some commonly used in a full.js file, which can reduce the number of file reads, thereby improving efficiency.
Xee: Multi-file Batch compression: Find WSH version in http://dean.edwards.name/download/, WSH version can be operated from command line! That is, you write a script and you can do it in bulk! Tough bar,!!!!!.
Xee:dean Edwards Some of the other works tools of cssquery This tool, a bit of a meaning, in contrast, I still like the choice of jquery way.
----------------------------------------------------------------------------------------?? --------------------------------------------------------------------------------
Finally, how is the compression tool decompressed?
Uncompressed (formatted) address: http://jsbeautifier.org/& http://lzw.me/pages/demo/jquery_search_suggest_plugin/
< reference: What kind of JavaScript minifier/packer/compressor do you use? & some of the experiences of using Dean's JavaScript Packer & also talk about JS compression, jquery compression >
js,html compression and obfuscation tools