note
jplindstrom
It depends on why you want to do it.
<p>
If the code/data is confidential, or sensitive, or a security hole, then you can't. Anyone determined enough can figure out what's served to the browser to execute. Code of this nature needs to be run on the server.
<p>
If it's just you not wanting to have your code copied and used by others, the method you describe may be enough to deter enough people.
<p>
To make it less valuable to others, you could also obfuscate or minify it. I'm sure you can Google for methods and tools for doing that.
<p>
/J
738643
738643