FAQ: How can I hide my source code?
Answer: You can't, and even if you could you shouldn't. Many people try different techniques to try and hide their source code from their visitors, but each and every method you can use is not guaranteed to work in all situations.
Disabling the 'right-click' menu is one such way that people attempt to stop you from viewing their source code. It might work for some people running Internet Explorer, but this method is easy to bypass. Simply by holding the right-mouse-button and then pressing return before releasing the button will, in most cases, allow access to the context menu. You can also access the source code by selecting 'View > Source' (or similar) on the menu bar of most browsers.
The real reason behind not hiding your source code is that the Internet is a way of sharing information and ideas - not hiding them - and if you don't want people seeing your ideas then you shouldn't put them on the web, but rather dig a big hole and bury them where no one can find them or better still keep them in your head. Once a visitor goes to your site, they download the whole page to their computer automatically and so they have a copy that they can do whatever they want to it.
Copyright laws pertaining to work on the Internet state that all of your published materials (i.e. original text, original images) is considered copyrighted as soon as you created it - it does not however extend to the source code of your site (i.e. HTML) and so you cannot stop people from copying your code, but you can do something about people stealing your text or images.
- Why no-right-click doesn't work
- Copyright basics for Web authors and users