3.  What goes on my page?


Return to review  Return to Roadmap  On to goals



Section Summary



What can I do on my own?



What can I do with an artist's help?



What can I do with a programmer's help?

There are two ways to look at what you can do with a programmer's help: what the user sees (forms) and what gets accomplished (applications).

Full-blown forms: forms are the visible HTML mechanism that permits people reading Web pages to provide information to the server, either by selecting among offered choices or by typing into blank fields. In general, the information provided by the user of a form is processed by a Common Gateway Interface ("CGI") computer program. In some cases, such as search engines, the resulting output is sent back to the browser as HTML, to be formatted for display. In other cases, such as a guestbook, the information may just be stored away for use by the publisher of the Web page.

Web-based applications: time-shared systems (e.g., Student Information System databases) traditionally provide user access to applications software through character-cell terminals. With the Web, we have the possibility for a much more robust approach, using the Web browser as a universal user interface. This has the nice feature that the application programmers can concentrate on their application without having to worry about what hardware or software the user prefers; HTML provides the lingua franca.



What about CGI, Java, and Javascript?

When you work with a programmer on a web-based project, there are two possibilities: the program may be executed on the server or on the browser.

Server-based Execution

The program may be executed on the server, with the web browser providing the user interface. This is routinely provided under the name "CGI scripting."

CGI scripting works well in a situation that will involve a modest number of simultaneous browsers. If too many people run the program at the same time, the server system will be brought to its knees, slowing down or even preventing the presentation of other web pages from that server.

The CGI program may execute on the server with the identity of the web server, in which case it will have access to a great many files on the system. In such a case, there will need to be appropriate precautions to ensure the integrity of the system.

The CGI program may execute on the server with the identity of the individual authorized user who wrote it. In this case, the CGI program will have access to all files on that server that are owned by that user, including any personal E-mail files that are kept on that system.

CGI scripting is much more robust with respect to variations among browsers. As such, it is especially well suited to applications that will be used by the general public.


Browser-based Execution

The program may be executed on the browsing computer. This is available with some recent browsers using Sun Computer's "Java."

Java has the advantage over CGI that the available resources for executing the program grow in exact proportion to the number of people running it, instead of being constant.

The disadvantages of Java include the following:

Limited Universality

Browsers run on all sorts of hardware and software, so providing access to the intended functionality will depend on the availability of a Java-capable browser for the particular hardware and operating system that the user already has on his or her desktop. Many people will continue to use pre-Java versions of browsers because they have too little RAM or because they only have free access to the old version. Visually impaired people are much more likely to use Lynx, which does not include Java.

For applications that are intended to be used by a controlled audience ("intranet"), where you can be assured that a particular browser is installed (or at least readily available), this disadvantage is much reduced.


Limited Security

Java is a real programming language. An evil Java program could be embedded in a page that you innocently browse to. Such an evil Java program could, for example, erase your entire hard disk right then, or it could modify the system startup files so that the hard disk got erased the next time you start the system. It could also send copies of all your data files to someone else on the network, one at a time, while you continue to browse. There is no obvious limit to the mischief that could be done with Java.

If the browser has been flawlessly written, it will enforce limitations on the running program ("it has to play only in its own sandbox") to prevent the Java program from doing anything nasty. Many people who have Java-capable browsers will configure them to leave Java turned off because they don't trust the browser to be bug-free. This is a realistic fear: at least one version of Netscape's Navigator and at least one version of Microsoft's Internet Explorer have been released that permitted a Java program to erase files from the user's hard disk.


Limited Performance

Translating program source code (ASCII text strings) into machine language instructions (binary code) can be done in advance ("compiled"), at execution time ("interpreted"), or partially in advance and completed at execution time ("pre-interpreted"). These three strategies differ in their efficiency as measured by execution speed of the program, in their portability among hardware and software environments for program development, and in their portability among hardware and software environments for program execution.

Java can be either interpreted or pre-interpreted. This has made it possible to produce Java program development environments for many platforms, and to produce Java execution environments for many platforms, but it does slow down the execution speed. This shortcoming is being reduced by speed increases in personal computers and by growing sophistication in the Java software, but it will always be an issue for some applications.

Netscape, in a marketing deal with Sun, calls their "macro" scripting language for their browser "Javascript." Although there is some superficial similarity between the Java programming language and the Javascript macro language, the two are truly distinct. Javascript was introduced in Version 2 of Netscape Navigator, and significantly enhanced in Version 3. Javascript macros should evoke less concern about security issues than Java programs. Browsers that are Javascript-capable can be (and are at times by some users) configured to ignore Javascript.



When should I use Java?

You should avoid using Java or Javascript on your home page, and use it on other pages only when necessary to accomplish a required function. Web pages that depend on Java will not be displayed as intended by the author whenever they are viewed by a reader whose browser does not support Java, or whose browser is configured with Java disabled.

Some pages containing Java have been observed to crash Lynx. This obviously prevents those users from seeing your page and also prevents your pages from being included in any keyword searchable index that is created using Lynx as the "crawler."

Some pages containing Java or Javascript have been observed to crash Netscape, or to freeze the whole system, forcing your reader to restart his or her computer. This is user-hostile and does not create a favorable impression of your organization!

Netscape Version 2 implemented Javascript in a way that is not entirely compatible with later versions of Netscape, so if you use Javascript, be sure to check out the behavior of your page as seen on Netscape Version 2.



How does Java Work?

The HTML file can contain either the source code for the Java program (enclosed in a <SCRIPT> block) or the file on the server containing the Java program can be referenced by a special tag (<APPLET CODE=AppletName.class>) identifying its URL.

More information about Java is available on-line:

If the source code is part of the HTML, then the browser must be able to interpret that source code so as to execute the program.

If the program is referenced by a URL, that file must be brought down through the network from the server and executed.


Return to review  Return to Roadmap  On to goals


Dick Piccard revised this file (http://oak.cats.ohiou.edu/~piccard/oacrao98/pages.htm) on November 4, 1998.

Please send comments or suggestions to piccard@ohio.edu.