开发者

How to compress javascript? [duplicate]

This question already has answers here: 开发者_如何学JAVA Closed 11 years ago.

Possible Duplicate:

How can I obfuscate JavaScript?

Hi,

I want to compress a JavaScript code but not just to remove whitespaces also I want to change all variable names to unintelligible names. How can I provide this ?

Thanks in advance,


Compressing is one thing, and the process of changing variable names to unintelligible names is called obfuscation. For that, you will need to use a javascript obfuscator or yuicompressor which does both.

Similar question(s) on SO.

  1. How can I obfuscate javascript?


just to add a bit http://code.google.com/closure/ can also be used


I recommend YUI compressor.


Online Javascript compressor


Either of the following will serve you well:

http://code.google.com/closure/ and http://developer.yahoo.com/yui/compressor/


I'm quite fine with yuicompressor that obfuscate also


http://www.crockford.com/javascript/jsmin.html

http://jscompress.com/

http://developer.yahoo.com/yui/compressor/


I dont know if you tried googling it but this what i use:

Javascript Compressor

It is a good idea to have your code pass in JSLINT first to assure it works


Or Uglify, an alternative to YUI compressor that requires node.js.


That is called obfuscation. Check out this question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜