To overcome these deficiencies, a mechanism called CGI Scripts is usually used: CGI (Common Gateway Interface) scripts are programs that are installed on the Web server - not the web client - and that can process information that a Web client such as Netscape gives them. Almost all forms, for example, are filled out on the client, and then submitted to a server, where a CGI script processes the information and delivers an appropriate response. A very common mechanism is a Search, where the user enter some key phrases, the CGI script searches a database for appropriate responses, and delivers those back to the user's client program. CGI scripts can overcome the first two problems, BUT
What is Java Script and Java AppletsJava Script and Java Applets are convenient methods to provide
In addition, they provide advantages over CGI scripts, since:
Java ScriptJava Script is a simple, object-oriented, interpreted programming language that provides methods (or functions), commands, and event handlers that can be embedded right into an HTML document. You do not need to compile your commands, and you do not need any special programs to create Java Script programs. Java Script programs run on any machine using a Java Script-aware browser such as Netscape. Java Script programs are, however, somewhat limited in their abilities but almost all "nice" web pages use them to improve their look and feel. Creating JavaScript Anybody who can create HTML pages can also create Java Script programs embedded in an HTML document. No special privileges are needed, and no special software or hardware needs to be used. If you place your Java Script enhanced HTML document on a web server, anybody can access that page and run the JavaScript program, if they are using a JavaScript-aware browser. To define JavaScript functions that can be used inside an HTML document you usually place special code between the <HEAD> and the </HEAD> tags at the top of the page. You can also (optionally) hide the JavaScript code from non-JavaScript aware browsers by using comments, as in this example: <HTML> <HEAD> <TITLE>Title of document</TITLE> <SCRIPT> <!-- Start of script statements function Welcome() { document.writeln("Welcome to Java Script"); } <!-- End of script statements --> </SCRIPT> </HEAD> <BODY> <H1> <SCRIPT> <!-- Welcome() <!-- --> </SCRIPT> </H1> </BODY> </HTML> JavaScript Examples: Click the link on the left to see the code in action, and the 'Explain' link for some brief explanation. NOTE: All examples work with Netscape 4.5 or above, and probably with 4.06 and above. If you are using another web browser, and things do not work as advertised, first download Netscape 4.6 and try again - it should work if you are using that web browser ....
For further (extensive with plenty of detailed examples) information on JavaScript, please check
JavaJava is an object-oriented, very complete, machine independend programming language that can be used to create either stand-alone programs or programs that are embedded in a Java-aware Web browser (such programs are then called applets). The Java programs need to be compiled before they can be used, and you need a special Java compiler to create the Java programs. Java programs run on any machine as standalone programs, complete with Graphical User Interface, or they can be embedded into a Java-aware browser such as Netscape. Java programs can incorporate almost any features, including graphics, menu, and networking features, that are expected of any other Windows program, and since it is a compiled language, it runs fast. To write a Java program or applet, you must create the source code in a *.java file and then compile it into a byte-code file called *.class. The class file then contains the runable applet or program. Creating Java Applets In theory, anybody can also create Java programs, which could be either embedded into an HTML document, or distributed as a stand-alone program for any type of computer. However, it is not trivial to create Java programs, and you need at least:
If you created a standalone Java program, anybody could use it (if they can access it). If you created a Java applet (a Java program embedded into a Web page), and you placed the program and the corresponding page on a Web server, then anybody who has a Java-aware browser can use your program without further setup. To create Java applets is, generally, difficult. To use Java applets, on the other hand, is very easy - if you find an existing one that will serve your purpose. In any case, you need a Java aware web browser to see them in action:
The public-domain browser that started the whole Web hype, NCSA Mosaic, may never become Java aware - unfortunately. To use Java applets in a page you need to have:
To use the applet, simply put the <APPLET> and the </APPLET> tag together with the appropriate parameters into your HTML document and the applet will run at the indicated spot. The Applet tag has the following form: <APPLET CODEBASE="basedir" CODE="filename.class" WIDTH="xxx" HEIGHT="xxx"> <PARAM NAME="param_name" VALUE="param_value"> <PARAM NAME="param_name" VALUE="param_value"> <...> </APPLET> For non-Java aware browsers, you can put any standard HTML code and/or tags between the APPLET tags. It will be ignored by the Java-aware browser, while the non-Java aware browser will display it and ignore the APPLET and PARAM tags.
|
Bert G. Wachsmut |