• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

HTML - Hide source code

How do you hide the source code for your web pages?  I have gone to sites where you cannot see there code.
2 Solutions
Alan HendersonCommented:
You can disable right clicking on your page. See here:

But this may annoy some of your visitors. They can't access other functions like bookmarking your page.
Alan HendersonCommented:
There's also a commercial product here:
Don't let this fool you! Open this "encrypted" page in Firefox, with Firebug installed, THEN view the source using Firebug, and you'll see the complete HTML structure. If you click the edit-button in Firefox, you get all source code, no problem. The encryption has disappeared! Completely vanished. This is vaporware!

And this so-called right-click trick, that's only for IE users. And it doesn't apply to the view source via the menu.

Please show us these sites where you couldn't see the code. I'm curious!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

If you want to hide your code, then you can use Flash, or make everything an image, or create a java applet, or maybe ActiveX if it's IE only.
there is no good way that works 100% of the time...

other than the ideas to use FLASH only, but if your site is HTML there is no full proof way.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you cannot hide the html resulting code.
the browser NEEDS that code to display the page.

what do you want to "hide" from the end-use of the source, actually?
And why do you want to hide it?

Is it Google, that you don't want Google to find certain things? Then use robots.txt to let search engines know what to index and what not.

Do you want to prevent other developers from copying your code? If you have done something unique and really valuable, the best way to protect it is to put a copyright notice in it, to document it and publish that in a blog. Then you get credit for it, people will find you and some will pay you to do your trick.

But probably somebody else has already done this, and you better accept the idea that this is the way it is, and aren't you copying for yourself as well? (We all do!)
> I have gone to sites where you cannot see there code.

You didn't try hard enough.

Alan HendersonCommented:
You still shouldn't do it except in exceptional circumstances.
Here's why:


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now