There is no way to hide source code from browsers; that is what they use to render your page. Even if the browsers did not make a "view source" option, then it would be trivial to telnet to your webserver port and spoof a browser. Until there is a standard for compiled javascript (I'm not holding my breath) it will be a plain-text interpreted language.
Now, there are tricks you can use to make it harder for people to get your source such as using external js files and setting your oncontextmenu or onclick handlers to make it harder to "view source". However, these just add an extra step. Anyone can access your source trivially no matter what tricks you use.
The only way to really hide your source is to turn off your webserver.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.