This article covers a number of techniques including:
- Source Code Padding
- No Right Click Scripts
- "JavaScript Encryption"
- HTML Protection Software
However the article concludes:
Unfortunately, the short answer to this question is, you can't [hide your source code]. There have been various methods put forth, but all of these are easily circumvented. In the end, the only sure fire way to make sure no one can steal your source code is to never put it on the Internet at all.