views:

192

answers:

3

Possible Duplicates:
How can I obfuscate JavaScript?
What do you use to minimize and compress JavaScript libraries?

hi all,

2 questions:

  1. i'd like to compress my code, anyone knows which compressor the guys from jquery are using? or is there any free script? (i'd like to use the compressor using an automated asp-script, so no standalone software)

  2. is there a good code obfuscator which makes it harder for code stealers? best would be a combination of packer+obfuscator :)

thx

+2  A: 

This is what I use: http://developer.yahoo.com/yui/compressor/

My advice is to not bother with obfuscation, if someone really wants to steal it they can.

Radu
+3  A: 

There is a really great compressor from Google called closure compiler:

http://closure-compiler.appspot.com/

There are three different degrees of compilation you can use.

  1. WHITESPACE_ONLY

  2. SIMPLE_OPTIMIZATIONS

  3. ADVANCED_OPTIMIZATIONS

It also lets you compile your code programatically using an external API.

hitautodestruct
+1  A: 

Compressor:

http://javascriptcompressor.com/

Beautifier:

jsbeautifier.org

No there is no way to stop js from being stolen, but you can make it really really hard to understand. Obfuscate, Use function closures

Alex V