If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

As the others have said above, it is impossible to hide the HTML from users. You can do some things in JavaScript to make it a little complicated for them to see your code, but eventually you have to give the browser access to the real code so it can render the page. And anything a browser can decipher, a user can too.

Hi. Every web-browser downloads the complete source of your page, and regardless of whether you disable right click or not, the user can save a copy of this code, or view the source from the menus in any mainstream browser, no plugins or special knowledge required.

Even if browsers didn't allow this, a novice programmer could write a program in less than 3 lines of code to download and save the source of your page, all they have to know is the address.

If you want you could try making the code hard to understand. There are minifiers and obfuscaters for javascript (which shrink your code or make it hard to read).

You can also put most of the program logic on the server side so that people can read the output you send them (ie the pages), but not how your web application works (ie how decisions are made and page content is generated).

What is your purpose in trying to hide your code? If you explain that then maybe there are other ways to achieve what you want.

Agree with "Interfacetricks" there is no way to hide the code. With right click disable only beginners or someone who doesn't have much knowledge can be kept away from the code and if someone knows a bit about the code they will also know that in case right click is disabled they can go to File..>Save as menu and save the code locally then view the code. Then there are many applications that can save the complete site with all the css and images.
Client side code cannot be hidden.

Interfacetricks is right, the only way to hide your logic is to put it server-side using PHP or such like. But if your site is simple HTML/CSS there is no way to hide it. The browser has to be able to read the client-side code, so a user can as well. Using scripts to disable functions just pisses off the users. Forget it!

Hiding or Protecting a Source Code

Hi Guys, I am new here, but have been in the IT game for more years than you would like to think of.
In answer to those wishing to hide the source code, let me tell you that it is not possible, no matter what kind of scripts you may use,
as there is always a work-around method of viewing the source.
One can encrypt the source, and someone smart comes along and decrypts it.
The encryption/decription is freely available on the internet.
Now, just to give you a typical example of websites that you actually cannot view the source.
All one has to do is copy the address shown in the address bar and download it with a download manager.
If the source was written in PHP, not a problem, as after you have saved it to your directory, you will notice it
as video.php or whatever.php. Just rename the .php to .htm or .html, makes not much odds.
Once done, just double click on the change you have made and the source becomes visible.
If the visible source is encrypted, then just use the internet to decrypt it.