Webmaster Tools
How to Hide HTML Code & Javascript Source Code
by  Ozioscilator,  mangt@portaldepot.net
Last Modification Date : Tue, March 18, 2008

Website programming can be very demanding especially when you make your website interactive with javascripts or PHP files. You may find yourself in a position that demands hiding some code, for parts or all of a page's code. The following examples may help you.

Hide HTML Code:  HTML code can be hidden in various ways and to various degrees. To hide part of a page or a block of code you can use an HTML encryptor. There are many, free html encryptors, on the internet but the best one we found can be viewed at DesignerWiz - HTML Encryptor. The encryptor is great for hiding blocks of code, you may even be able to hide an entire page of code but it is not recommended.

To hide an entire page of code you might consider creating a frameset page to establish a top frame and a bottom frame. In the top frame you simply put a "period" and in the bottom frame you place all your html code. This method won't hide the code from all experienced viewers, but for most viewers when they click view source, only the frameset page will be displayed. However, the frameset page will contain URL links to the frame pages, an experienced viewer could get a fast look by placing the frame URL's in their browser. To eliminate experienced viewers from flashing your frame pages, you could encrypt the frameset page, with DesignerWiz's HTML Encryptor, to hide the URL links to the framed pages.

Hide Javascript Code:  You might find a need to hide valuable javascripts from the public's eyes, like in our Portal Depot site we sell Javascript code so it was important to find a method to hide our demos from our viewers. The best method we could come up with was to place all scripts in a separate .js file which would be called from:

<script src="../YourFile.js"></script>

statement. By putting the code in a separate .js file, you elimminate displaying the code in your html document. However experienced viewers could still get a look at your code when it is in the .js file format. So to eliminate reading the code in the .js file we decided to then encrypt the code within the .js file. To do this we implemented the, Javascript file encryptor, at Javascript File Encryptor - Virtual Promote . The encryptor works great and it's free. You can encrypt the script on the original html page or you can encrypt the javascript code and place it in a separate .js file.

There are other ways of hiding entire web documents, by using Server Side Include files. However, you need a server with SSI capabilities, and the method used is beyond the scope of this article. I have come accross a website that completely hides any and all code. We don't know exactly how they do it, but when you try to view the source code, a blank page pops up. The website is iWon.com . If any one, that reads this article, knows how they can make the view source code come up blank! We would appreciate hearing from you feedback@portaldepot.net .



Refer This Page To A Friend Bookmark This Page
© Copyright 2007
Powered by Tech Systems.com


CreditCards (6K)