This question gets asked fairly often on this forum, so we've assembled here a definitive answer to the question of how one can hide their HTML source from people. Unfortunately, the short answer is, you can't. 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. Source Padding Really, the oldest trick in the book. It involves adding a ton of white space before the start of your code so that the view source menu appears blank. However, must all people will notice the scroll bars and will scroll around to find your code. As pointless and silly as this method is, there are some still who use it. No Right Click Scripts These scripts stop users from right-clicking, where the "View Source" function is located. Cons: Notoriously hard to get working across browsers and to actually work properly. The right-click menu, or context menu, includes many helpful tools for users, including navigation buttons and the "Bookmark Page" button. Most users don't take kindly to having their browser functionality disabled and are inclined not to revisit such pages. The View Source function is also available through the top Menu. At the main menu bar at the top of your browser, select View, and then in the sub-menu, you'll see "View Source" or something similar. Also, there are keyboard shortcuts like Ctrl+U that can be used to view source. All this method does is add about a two second delay to someone trying to view your source and it does irritate users who aren't trying to view your source. "JavaScript Encryption" This is by far the most popular way to try to hide one's source code. It involves taking your code, using a custom made function to "encrypt" it somehow, and then putting it in an HTML file along with a function that will decrypt it for the browser. A User is able to view the source, however, it isn't understandable. Cons: Your website is only usable for users with JavaScript enabled. This rules out search engines, users who've chosen to disable JavaScript, and users using a textual browser (such as the blind) that doesn't have JavaScript capabilities. Remember, JavaScript is a luxury, not a necessity on the web. You have to include a means of decrypting the page so the browser can display it. Someone who understands JavaScript can easily decrypt the page. Many browsers provide alternative ways around this. Some, like Netscape 7.0, allow you to save the page, decrypted for easy viewing later. Others, like FireFox, include tools like the DOM Inspector, which allows you to easily view and copy the XML of the page, decrypted. HTML Protection Software There are some less than honest people who want to sell your software to quickly and conveniently "protect" your source code. This type of software generally employs the above methods, in varying ways, to hide your source code. Many people think that if they are buying it, it must work. It doesn't. As we've seen, the above methods are all easily circumvented, and all this software does is implement these horribly flawed methods for you and take your money. Don't fall for them, I've yet to see a single one that's worked, and they never will. Isn't there Any Hope? The bottom line is that browsers need to see the unencrypted, plain text source code to create a webpage. For that reason, it's impossible to hide your HTML source code. If the browser can read it, which it needs to be able to do to render a webpage, then so can a user. That's the bottom line. But My Page Was Stolen! A lot of people look for this after having their website pirated. I know it's cruel that in a few minutes someone can steal hours of your work, but hiding your source code can't help you. Contacting the person in question and asking them to take it down solves many cases. Otherwise, contact the web host or the persons ISP and explaining the situation is a good course of action. I can't give you legal advice, but if you feel your copyrights are being infringed, you can contact a lawyer. But hiding (or "encrypting") your source, won't do much of anything at all.
The fact is that if you don't want stuff stolen . . . don't put it online. Just a fact of the Internet. And some of this functions like no right click can tick off honest visitors, encryption can always be decrypted - so it's not worth the time. My 2 cents. Skinny
Hmm, it was nice of you to post that info here to help people out, but what I find a bit ironic about this post is that it is about being able to protect information on a webpage, yet you have taken this content from a 2 year old thread at http://www.webdeveloper.com/forum/showthread.php?t=89947 Sorry, but I found it kind of funny However, yes there is some good information here. It is virtually impossible to hide source code from users eyes, html anyway. It cant be hidden from users and it cant be hidden from website-scrapers. You can stop a website-scraper from reaching your web-pages via a robots.txt but sometimes it might be too late before you find out the name of the software that has scraped your site and content. TD
If you're so ashamed of your code that you don't want people to see it, you shouldn't be coding anyway : )
yeah nice summary post was looking for something on this, guess all the methods are pretty useless, but another method to stop people from stealing is to watermark everything, for example your pictures, flash creation etc... as for articles you can take action if somebody takes them..
It's no use, men! With Firefox, guess can easily get your source code and download all things they want from your website
Any browser with something like NoScript : ) "Stealing" code is silly, it's like seeing a house who's design you like, and building one just like it. Hardly theft. Images, on the other hand, can indeed be stolen and should be watermarked. Any art created by someone is automatically copywrit; however in order to actually sue someone for damages from theft, the art needs to be registered too.
There are some scripts was putted on your header that disallows your mouse on to "right click" option.. That either IE or Firefox browser that youre using it will not allowed the right click option which you can not used the "view source" option in the browser.. I refer you guys to copy and learn some good scripts code in the Scripts.com there's so many scripts there regarding on your request!!
Gotta love "blind posting" (where people don't even read the original post and reply to the title of the thread).
Some of you may have encountered this puzzle previously -- it is a great challenge -- a good way to test your web authoring skills and a nice diversion from "headaching" coding sessions. It also illustrates the futility of trying to hide source code If you crack it, don't post your hidden message answer here just yet -- I will do so after a short while. http://www.drpeterjones.com/hidden/hidden.php
i found it in article website it's not copyright breaking maybe i took 2 years to write this reply but i swear i found it on website such as ezine articles, ...
Sooo old - why respond when the post is dead? Trying to hide your HTML/CSS/JavaScript is absolutely pointless... the browser needs the source code to render the page. Use telnet to grab the source if you're trying to disable right click (or just hit Ctrl+U) and use debuggers to step through it if it's 'encrypted'. Obfuscating code is a complete waste of developers time... which we're very short on as it is. Just make things pretty, if people copy you - consider it a compliment.