Web Development
7 replies
by 4u21der
There is no way to "protect" html source from being viewed. The best bet if you wish to hide code and or styles is to use a scripting language like ( ASP or PHP or CGI ). You can also include files that have links to a Style Sheet.
Hope this helps.
Good Luck!
by johnlcooke
by ann777
by johnlcooke
by kschang
Indeed, there is no way to "hide" the source code for HTML, since HTML is not a programming language. The browser does not translate the HTML in any way, it merely interprets the input and displays the content with the layout/format specified.
As a workaround, there are ways to obfuscate the code, and even semi-encrypt the code by using Javascript. However, it is easily decoded (indeed, it MUST be for the browser to display it!)
One trick you can do is remove all the carriage returns inthe HTML source code. It will be utterly unreadable in "view source" format unless the reader spends time adding them back.
You can find the Javascript "encryption" via search engines easily. You can also use Javascript to disable right-click, go into "kiosk" mode, and such, which would make viewing the source code more difficult, but it's not possible to completely disable the source code viewing.
by johnlcooke
by johnlcooke
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending