Hiding HTML codes

Posted on 1998-10-27
Medium Priority
Last Modified: 2010-04-09
How can I hide HTML codes whenever View Page/Frame Source is clicked from browser's menu or popup menu by the surfer?
Question by:Admavira
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 1839067
it would be an excellent help if a sample code could be provided to show how HTML codes could be hidden.
LVL 10

Expert Comment

ID: 1839069
Every HTML web author wishes they could hide their HTML code, but you cannot... The only thing that you can do is to place a copyright identifiation within the page and hope that people are honest..


Author Comment

ID: 1839071
Is there a way to remove the file from the cache and disable Save As and Page Source in browser's menu?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Expert Comment

ID: 1839072
If you have any particular parts of functionality you wish to hide completely then the only way (without messing with the browser which might not work and might annoy people) is to stick in all in a Java applet.

Expert Comment

ID: 1839073
Whhat type of thing are you trying to hide?  Since HTML is a presentation language,  nothing about it is secret or copyrighted.  Maybe cgi would work for you.

Accepted Solution

ivancho earned 300 total points
ID: 1839074
The only thing you can do to harden the reading of the page is to use only CR as the end-of-line marker.
Usually windows based text editors put the CR/LF combination at the end of each line. If you strip the LF character, it will be very hard to read your HTML code with notepad, which is the default editor poped when someone wants to view the source. Even more if you avoid the CR characters, usually Notepad cannot display normally too long lines, even if "Wrapping" is enabled.
Warning to remove the CR/LF chars you must edit your html page with some word processing tool, not with notepad.
Notice this will NOT work if the page is saved and then viewed with wordpad. Unfortunately this is ALL you can do.

Expert Comment

ID: 1839075
all you need is a a JavaScript program to encrypt the codde so it is secret.  one is avadible for free at:
this program encrypts the code into Jscript then decrypts it on any Jscript enabled browser.  It is not perfect but it works pretty well.  If this works I will post this as a answer.(after you reject jvancho's answer)

Expert Comment

ID: 1839077
I know what it says but it seemed like the best solution for teh problem.

Expert Comment

ID: 1839078
Works well except it screws up existing Jscript but you can add it to the encoded copy.  It also adds a banner at the top and the bottom, I am sure somebody who knows tons about Jscript can tell you how to remove it.  thry it I think it works well.  If you are not worried about experts you could do a frame code with the frae mat 100%, then 0%.


Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question