JavaScript
Java
JavaScript and Java are very different languages.
JavaSript intended for nonprogrammers.
A Java program or Applet, can be loaded by HTML page and executed by the
Java Interpreter, which is embedded into the browser. Java is a
object-oriented complex language like C++ language.
Java is more than a programming language.
Java knocked down the walls between different various of personal computers,
letting any program run without conversion on any kind of machine. It does
things other languages does, but it does it better.
JavaScript
JavaScript is a object-oriented simple language intended for nonprogrammers
to improve a Web page.
No development tools or compilers are required.
JavaScript can run on the browser without being compiled.
JavaScript source code can be placed directly within an HTML Web page or
referenced in a separate file.
JavaScript source code is interpreted directly by the browser.
A JavaScript program within an HTML document:
<BODY>
<!-- window.alert("
... "); display a message to the user in a screen dialog box. Click X to close it. --!><SCRIPT
LANGUAGE="JavaScript">
</BODY>
</HTML>
CGI
The biggest difference between JavaScript and CGI is that CGI works on the
server and JavaScript works on the user's own machine (the client). CGI is
most useful for sending data to the server and sending server data back to
the user.
What happens when you request a Web page from a server?
When you enter or select a URL:
1) The browser sends a Get request to the server.
2) The server sends back to the browser the Web page requested by the
browser.
3) The browser sends a request for each graphic to the server.
4) The browser allocate space for graphics on your PC and display the Web
page without waiting for the graphics arrival.
5) The remaining graphics are displayed as they received.
Processing the JavaScript:
1) After the server sends the HTML Web page the browser, and the browser
received it.
2) The browser examines the HTML for <script> tag.
3) If a <script> tag is included the browser process the script.
The Process of a JavaScript depends on the Type of Script (Choose
one):
1) If the script is included in the header, it is ignored unless another
script calls it.
2) If the script is included directly in the body, its output will be
included in the Web page.
3) If the script is an event handler for a specific part of the page, it
will be processed only when the event happens.
JavaScript make a Web page Interactive:
JavaScript cannot access any data on the server or send data to the server.
CGI is the easiest way to do this.
You can display the current date and time.
You can include information depends on the user's input.
You can also display the information you need to change in a separate
frame.
Using JavaScript you can reload the page with different contents, but you
can't change the text on a page.
You can change the images, and anything in a form element.
Your Source Code is Accessible:
You legally have a
![]()
How can you prevent the
"HTML Source Code" for a document from being viewed?Features:
-
How secure are the methods used by
"HTML Guard" ?1. Encode source code
By encrypting HTML source code you protect your web site from being easily stolen. The code becomes indecipherable to both the human eye and to HTML editors. To display an encoded page, the browser will decrypt the file's source code by executing a JavaScript. As the required decryption script is embedded into the source text, everyone is able to read it there as plain text. This is perhaps, like giving away the lock together with the key. Consequently anybody with JavaScript skills may analyze the script and get the original source text this way. However approximately 99 percent of all Internet users will certainly not be able to overcome this obstacle.
"Squeeze" source code (remove line feeds)
Removing unnecessary line feeds and blank characters leaves the source text looking extremely intricate and difficult to read, because the original structure of the code will be disturbed. Although manual editing is made much more difficult in this way, visual HTML editors can process the "squeezed" code without difficulty. Furthermore programs are available that are able to convert unstructured source code into clearly arranged HTML.
3. Insert blank lines
"HTML Guard" offers the option to add blank lines to the top and the end of your source code. This way it will appear to the viewer as if no source code is available. In order to intensify this effect you can enter an additional text such as "Source code not available" which will be shown at the top of the code. This method is a relatively simple diversion which a professional will certainly never be taken in by, because the source code can easily be reached by scrolling down the window. However, searching for the source text can be made significantly more difficult by increasing the number of blank lines. When using this option you should be aware that each additional empty line increases the file size by two bytes.
4. Lock the menu on the right mouse button
To prevent copying of images and links you can disable the right mouse button in the browser. Consequently the menu that normally appears after a right click will no longer be available. Unfortunately, this method currently only works with Internet Explorer (version 3.0 and above) and Netscape Navigator (3.0 or above). The majority of other available browsers, while in the minority, are unaffected by the right click protection and both images and links can be copied using the right mouse button. Furthermore you should consider that people do not like to be restricted too much and therefore a complete deactivation of the right mouse button might be an unpopular decision. That is why we include the option to "Disable right click on images" to allow you more flexibility.
5. Block text selection
Using the "Block text selection" option, you can stop visitors from selecting text, images or other elements in their browsers. This prevents people from copying your content to the clipboard. It should be noted that this method only works with Internet Explorer 4.0 and above. However, with Microsoft's Internet Explorer being so widely used, this option will prevent the majority of users from stealing your content.
6. Print only blank pages
Selecting the "Print only blank pages"option will prevent your visitors from printing your pages. Each print attempt will merely give out a blank page. Unfortunately this function is only available with Internet Explorer 5.0 or above. Be aware that no warning is given, so users may suspect a faulty printer or defective software.
Having read the above text, you will be aware that "HTML Guard" is no general purpose weapon for the protection of HTML pages. There is always a way to reach the source code and elements of a page, but how many people do you know that are good enough at JavaScript programming to bypass the source code protection? Would your friends not be impressed by a message like "Function not available" after right clicking an image? For the majority of Internet users, the protection mechanisms will be an obstacle that they cannot overcome without seeking outside help. In many Internet and Usenet forums the question about protection possibilities of HTML pages is a "Frequently Forbidden Question" (FFQ) that is answered unwillingly, if at all, and rarely without a cynical comment. The reason for this is that HTML is an open principle and almost every webmaster has gained experience by studying the source code of others. However, protecting text, images or scripts should not be considered as moral abjectly because this is the custom in other fields - and who would like to find content that had been created after spending enormous amounts of time, on somebody else's web site? Please remember that excessive use of protection and limitation could prevent visitors from returning to your web site.
Ahmed Hamdy Eissa's E-mail Address