Is it possible to hide or scramble/obfuscate the javascript code of a webpage?

It is good practice to minify your JS with a tool such as YUI Compressor. I would not obfuscate it unless you have a specific need to do this. There are plenty of online obfuscators such as this one

See this article: http://developer.yahoo.net/blog/archives/2007/07/high_performanc_8.html


Check this out.

Other than min'ing it, I don't think you can really hide js. It all goes the user's browser and there are plenty of ways of seeing it once its there.


See here for a Free Javascript Obfuscator.

Given that it is in fact possible, if the reason you intend to obfuscate is to protect intellectual property, you are probably trying to derive value from your work the wrong way. It's fairly easy to reverse the obfuscation, and you would probably be wasting time maintaining your code.

Focus more on what services you intend to provide to those who visit your site as a means to differentiate your site from competitors