You can't. See my long explanation as to what people have tried and why it didn't work: http://dorward.me.uk/www/hide/
2007-03-13 22:41:32
·
answer #1
·
answered by David D 7
·
0⤊
0⤋
There's no good way to do it.
No matter what you try, in the end, the user's browser is going to decide whether or not it lets the user view the source, and there is no way for the server to control that (nor should there be).
If there is sensitive information 'hidden' in the HTML, whether it's HTML, CSS or JavaScript, it shouldn't be there. It may just as well be published in a newspaper. If you're trying to protect the code, have it run on the server instead of the client. If you're trying to protect the formatting information (the HTML itself), you're out of luck.
You can try to obfuscate it (make it harder to read), but that's generally going to make your site harder to maintain. It can't be encrypted in a traditional sense without making the browser unable to understand it.
If you really want to spend the time and energy (which I'm not recommending), you could make it really hard to read by encrypting the page contents and using JavaScript code to decrypt and render it, but even if you do it that way, it'd take someone like me under ten seconds in Firefox to get it, because you'd have to give the browser the keys to the encryption too.
I guarantee that whatever you're trying to hide is not worth the effort.
2007-03-13 22:36:20
·
answer #2
·
answered by MD 2
·
1⤊
0⤋
You can't.
View Source is a function in virtually all browsers which display the source code of the website being viewed. This is a browser function, so anything you put on a website will not stop it.
Why would you want ot hide the source anyway? What's the point? Every single website on the internet, without exception, has it's source code viewable.
2007-03-13 22:43:46
·
answer #3
·
answered by Mighty Oats 2
·
0⤊
0⤋
That's not possible except you are concerned with certain web scripting technologies such as asp.net, php, jsp,coldfusion ...etc.
When they run, they get rendered into standard HTML so no one will see the code, but for standard HTML code, it's a must to be there and you can't hide it; however, there are issues such as displaying your css, css could be better off written in a file and just called from your html script; hence, users will not be able to see the css you wrote.
I still assume you might be concerned with server-side scripts which will not be shown.
For instance:
...... in ColdFusion will be rendered to the clients as standard HTML tag;
tags to the end client and so on.
2007-03-14 04:00:59
·
answer #4
·
answered by Coosa 2
·
0⤊
0⤋
Are you saying program source code? Because if I remember correctly, whatever program source code in your HTML page will NOT be shown to the viewer. The only thing the viewer see in their web page is the source code needed to view the page. No calculation/formula/algorithm/complex codings will be shown.
2007-03-13 22:33:26
·
answer #5
·
answered by Eff 2
·
0⤊
0⤋
You can try googling for html scrambler etc..
This one encapsulates your entire source into a line of javascript that sort of obfuscates the code.
http://www.hypergurl.com/generators/htmlscrambler.html
There are several programs on this page also:
http://protect-html-source.qarchive.org/
Regards,
bleh -_-
2007-03-14 00:37:09
·
answer #6
·
answered by kaonic_decay 1
·
0⤊
0⤋
you can use a freeware html encryption program.
that will stop 99% of your visitors from "getting the source"
you could use frontpage, because with all the junk it makes in the source no one would want to really look at it. ;)
2007-03-13 22:35:46
·
answer #7
·
answered by beni_gabor 3
·
0⤊
0⤋
There are javascript codes that prevent the user from right clicking on your page.. However, I'm not sure there is a code to prevent going to View and clicking on Source. :P
2007-03-13 22:33:02
·
answer #8
·
answered by Jjjjjjj 4
·
0⤊
1⤋
fedest.com, questions and answers